GET Method
- 리소스를
조회 할 때 주로 사용
- 서버에 존재하는 정보를 검색하는 데 주로 사용 (ex. 유저 정보 조회)
- 요청을 해도, 서버의 상태를 변경하지는 않는다는 특징
Postman에서 GET Request 생성
- Postman에서 컬렉션 생성
- 컬렉션에서 "더 보기 (...)" 메뉴를 클릭하고 Add request 메뉴를 클릭
- 새로운 Request 가 생성되고, GET Method를 선택할 수 있게 됨

URL and Endpoint
- URL + Endpoint 로 구성
- URL : https://www.koreanjson.com
- Endpoint : /users
- URL + Endpoint = https://www.koreanjson.com/users
- [GET] https://www.koreanjson.com/users 해당 API 는 유저 정보를
조회 하는 API 임을 유추할 수 있음
Query Parameter
- GET 메소드는 주로
쿼리 파라미터와 함께 요청하는 경우가 많음
- 예를 들어 유저 리스트 페이지가 5페이지까지 있다고 존재할 때, 5페이지에만 있는 유저 정보를 조회하려면 쿼리 파라미터를 통해 호출 가능
- ex) [GET] https://koreanjson.com/users?page=5
- 이 때 page 를 key , 5는 value 라고 정의함
Script 사용하여 API 호출
- Python Script 를 사용하여 API 호출하는 것도 가능
import requests
base_url = "https://www.koreanjson.com"
endpoint = "/users"
response = requests.get(base_url + endpoint)
print(response.json())
[{'id': 1, 'name': '이정도', 'username': 'jd1386', 'email': 'lee.jungdo@gmail.com', 'phone': '010-3192-2910', 'website': 'https://leejungdo.com', 'province': '경기도', 'city': '성남시', 'district': '분당구', 'street': '대왕판교로 160', 'zipcode': '13525', 'createdAt': '2019-02-24T16:17:47.000Z', 'updatedAt': '2019-02-24T16:17:47.000Z'}, {'id': 2, 'name': '김재완', 'username': 'lastrites2018', 'email': 'jaewan@gmail.com', 'phone': '02-879-5000', 'website': 'https://github.com/lastrites2018', 'province': '', 'city': '서울특별시', 'district': '관악구', 'street': '관악로 145', 'zipcode': '08832', 'createdAt': '2019-02-24T16:17:47.000Z', 'updatedAt': '2019-02-24T16:17:47.000Z'}, {'id': 3, 'name': '김성은', 'username': 'sunnysid3up', 'email': 'sunny@daum.net', 'phone': '010-4280-1991', 'website': 'https://github.com/sunnysid3up', 'province': '', 'city': '서울특별시', 'district': '강동구', 'street': '성내로 25', 'zipcode': '05397', 'createdAt': '2019-02-24T16:17:47.000Z', 'updatedAt': '2019-02-24T16:17:47.000Z'}, {'id': 4, 'name': '이주연', 'username': 'yyijoo', 'email': 'jooyeon@gmail.com', 'phone': '010-2940-1401', 'website': 'https://github.com/yyijoo', 'province': '경기도', 'city': '용인시', 'district': '수지구', 'street': '포은대로 435', 'zipcode': '16835', 'createdAt': '2019-02-24T16:17:47.000Z', 'updatedAt': '2019-02-24T16:17:47.000Z'}, {'id': 5, 'name': '구일모', 'username': 'johnnykoo84', 'email': 'johnny@gmail.com', 'phone': '010-8491-3982', 'website': 'https://github.com/johnnykoo84', 'province': '', 'city': '서울특별시', 'district': '강남구', 'street': '학동로 426', 'zipcode': '06090', 'createdAt': '2019-02-24T16:17:47.000Z', 'updatedAt': '2019-02-24T16:17:47.000Z'}, {'id': 6, 'name': '장원진', 'username': 'jangwj2931', 'email': 'jang@gmail.com', 'phone': '010-4811-0921', 'website': 'https://github.com/jangwj2931', 'province': '', 'city': '부산광역시', 'district': '부산진구', 'street': '시민공원로 30', 'zipcode': '47193', 'createdAt': '2019-02-24T16:17:47.000Z', 'updatedAt': '2019-02-24T16:17:47.000Z'}, {'id': 7, 'name': '최윤우', 'username': 'yoonooyoonoo', 'email': 'yoonooyoonoo@naver.com', 'phone': '010-3910-9849', 'website': 'https://blog.naver.com/yoonooyoonoo', 'province': '', 'city': '대전광역시', 'district': '유성구', 'street': '대덕대로 480', 'zipcode': '34126', 'createdAt': '2019-02-24T16:17:47.000Z', 'updatedAt': '2019-02-24T16:17:47.000Z'}, {'id': 8, 'name': '이강인', 'username': 'kanginlee', 'email': 'kanginlee@hanmail.net', 'phone': '010-9311-9411', 'website': 'https://twitter.com/@kanginlee', 'province': '전라북도', 'city': '전주시', 'district': '완산구', 'street': '풍남동3가 64-1', 'zipcode': '55041', 'createdAt': '2019-02-24T16:17:47.000Z', 'updatedAt': '2019-02-24T16:17:47.000Z'}, {'id': 9, 'name': '박동민', 'username': 'dongpark', 'email': 'dongpark@naver.com', 'phone': '010-4941-5092', 'website': 'https://dongpark.com', 'province': '전라남도', 'city': '광주광역시', 'district': '서구', 'street': '내방로 111', 'zipcode': '61945', 'createdAt': '2019-02-24T16:17:47.000Z', 'updatedAt': '2019-02-24T16:17:47.000Z'}, {'id': 10, 'name': '정지수', 'username': 'jisoocity', 'email': 'jisoocity@naver.com', 'phone': '010-8591-4011', 'website': 'https://instagram.com/jisoocity', 'province': '', 'city': '대구광역시', 'district': '중구', 'street': '공평로 88', 'zipcode': '41911', 'createdAt': '2019-02-24T16:17:47.000Z', 'updatedAt': '2019-02-24T16:17:47.000Z'}]