๐ ๊ฐ๋ฐ ๊ณต๋ถ 1๊ฐ์ ์ฐจ์ธ to-be ๊ฐ๋ฐ์์ ์์ต ๋ธ๋ก๊ทธ๐๏พ Aug 30 ~ Sep 3, 2021
ํ์ฌ ์ํ
RESTful API๋ผ... ์ง์ง ๋ชจ๋ฅด๊ฒ ๋ค.
RESTful API๋ ์ค๊ณ๋ถํฐ ์ ํด๋์ผ team member์ ์ฌ์ฉ์๊ฐ ์ ์ฌ์ฉํ ์ ์๋ค.
API๋ CRUD (Create, Read, Update, Delete) ๋ฅผ ์ํด ํ์ฉ๋๋ค.
์ด๋ API๊ฐ ํ์ํ URL์ ๋ชจ๋ ๋ง๋ค๊ณ ์ถ๊ฒ ์ง๋ง ์ด๋ ๊ฒ ํ๋ฉด URL์ด ๋๋ฌด ๋ง์์ง๊ณ ๋ณต์กํด์ง ๋ฟ๋ง ์๋๋ผ ํ์
๊ตฌ์ฑ์์ด ํด๋น URL์ ์ดํดํ๊ธฐ ์ด๋ ค์ธ ๊ฒ์ด๋ฏ๋ก ์ข์ ์ค๊ณ๊ฐ ์๋๋ค.
๊ทธ๋ฌ๋ฏ๋ก convention์ ๋ฐ๋ผ ์ ์ ํ URL์ ์ค๊ณํด์ผ ํ๋ค.
/create, /see, /get, /edit, /delete, /update, /find
/movies, /movies/inception
์ด๋ ๊ฒ ํ๊ณ ๋์ HTTP request methods์ ๊ฒฐํฉํ์.
ex. GET/POST/PUT/DELETE + /movies/(unique identifier)
์ด ๋ฐฉ์์ URL์ด ๋ ๊ฐ๊ฒฐํ๊ณ API์ ๊ตฌ์กฐ๋ฅผ ์ดํดํ๊ธฐ์๋ ๋ ์ง๊ด์ ์ด๋ค.
๊ฐ์ฒด๋ค์ ๊ด๊ณ interaction์ ์ํด URL์ ์ฌ์ฉํ ์๋ ์๋ค.
ex. GET/POST/PUT/DELETE + /movies/inception/actors
๊ฒ์์ด๋ filter๋ฅผ ์ฒ๋ฆฌํ๊ธฐ ์ํด์๋ ๋งค๋ฒ URL์ ์๋กญ๊ฒ ๋ง๋๋ ๊ฒ๋ณด๋ค query parameters๋ฅผ ํ์ฉํ๋ ๊ฒ ๋ซ๋ค.
ex. /getTopRatedMovies
โ /movies?main_rating=9.8
๏พ ๏พ ๏พ /findMoviesFromThisYear
โ /movies?release_date=2021
์ด๋ ๊ฒ query parameters๋ฅผ ํ์ฉํ๋ฉด pagination๋ ํ ์ ์๋ค.
ex. /movies?page=5
https://www.notion.so/wecode/RESTful-API-5c7dd63a49424652898f8b2d8b0c5791