Buisness Problem
ํน์ ๋์์ ๋ ์จ ์ ๋ณด๋ฅผ ์ ๊ณตํ๋ App ์ ์ ์ํ๋ค๊ณ ๊ฐ์ ํด๋ณด์. ๊ทธ๋ ๋ค๋ฉด external service ๋ฅผ ํตํ์ฌ ๋ ์จ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์์ผํ ๊ฒ์ด๋ค.

๊ทธ๋ ๋ค๋ฉด ์ด๋ป๊ฒ Third-Party ์ธ Weather Service ์ ์ฐ๊ฒฐ์ ํ ์ ์์๊น?
์ฐ๋ฆฌ๋ HTTP Protocol ์ ๊ธฐ๋ฐ์ผ๋ก ํ๋ REST API ๋ฅผ ๋ง๋ค์ด์ Third-Party Service ์ Application ์ ์ฐ๊ฒฐํ ์ ์๋ค.
REST(REpresentational State Transfer) ๋ HTTP Protocol ์ ๊ธฐ๋ฐ์ผ๋ก resource ์ ์ํ๋ฅผ ์ฃผ๊ณ ๋ฐ๋ Architecture style ์ด๋ค. REST ๋ ์ฃผ๋ก Web API ์ค๊ณ์์ ํ์ฉ๋๋ฉฐ, ์ด๋ฅผ ๋ฐ๋ฅด๋ API ๋ฅผ REST API ๋ผ๊ณ ํ๋ค. ๋ํ client ๋ server ์์ ์ฌ์ฉ๊ฐ๋ฅํ programming laguage ์ ์ ์ฝ์ด ์์ผ๋ฉฐ, data format ์ผ๋ก๋ JSON(JavaScript Object Notation) ์ ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉํ์ง๋ง, ์ด ์ญ์๋ ์ ์ฝ์ด ์๋ค.
Problem Solution
๋ง์ฝ openweathermap.org ์์ ์ ๊ณตํ๋ Weather Service API ๋ฅผ ์ฌ์ฉํ๋ค๊ณ ํ์. ๊ทธ๋ ๋ค๋ฉด ํด๋น API ์ฌ์ฉ์ ์ํ์ฌ๋ API documentation ์ ๋ฐ๋์ ํ์ธํ๊ณ ์ฌ์ฉํด์ผ ํ๋ค.
https://api.openweathermap.org/data/3.0/onecall?lat={lat}&lon={lon}&exclude={part}&appid={API key}
์๋ฅผ ๋ค์ด ์์ ๊ฐ์ API call ์์๋ lat ๊ฐ๊ณผ lon ๊ฐ, ์ฆ ์๋์ ๊ฒฝ๋๋ฅผ Weather Service ์ ์ ๋ฌํจ์ผ๋ก์จ ํด๋น ์์น์ ๋์์ ๋ ์จ ์ ๋ณด๋ฅผ response ํ๋๋ก request ํ๋ ๋ฐฉ์์ด๋ค.
์ฐธ๊ณ ๋ก REST/RESTful API, Web Services, Services ๋ชจ๋ ๋ค ๊ฐ์ ์๋ฏธ๋ฅผ ๊ฐ์ง๋ค๊ณ ์๊ฐํ๋ฉด ๋๋ค.