[Network] OPEN API
2022.12.05
💡 Open API
📌 Postman
웹 개발에서 사용하는 대표적인 클라이언트 브라우저
📌 Postman 사용하기
주어져 있는 API서버를 이용해서 간단하게 사용해보기
Get [ 데이터 받아오기 ]
URL : http://3.36.72.17:3000
// 메시지 조회
Request : GET /kimcoding/messages
// 추가적인 파라미터
roomname | 방 이름(문자열)
Response
[
{
"id": 1,
"username": "김코딩",
"text": "안녕하세요",
"roomname": "로비",
"date": "2021-04-02 12:00:00"
}
// ...여러 개의 메시지
]
Post [ 데이터 추가 ]
Response
{
"id": 5 (ex)
}
post 후 get으로 원래 데이터 확인
📌 Postman with Open API
openweathermap.org 페이지로 이동후 회원가입, API키 발급받기
API 리스트에서 Current Weather Data 들어간 뒤 By city ID에서 URI확인하기
api.openweathermap.org/data/2.5/weather?id={city id}&appid={your api key}
서울의 city id = 1835848
내 API key = bc9e459d84fde49321504e6b3161889b
Postman
Comments