๋ฐ˜์‘ํ˜•

๐Ÿฐ GET์— body๋ฌธ?

POST๋ฅผ ํ†ตํ•ด body๋ฌธ์„ ๋ณด๋‚ธ์ ์€ ์žˆ์ง€๋งŒ, GET์„ ํ†ตํ•ด body๋ฌธ์„ ๋ณด๋‚ธ๋‹ค๊ณ  ์ƒ๊ฐํ•ด๋ณธ์ ์€ ๊ทนํžˆ ๋“œ๋ฌผ๋‹ค.

 

์ผ๋ฐ˜์ ์œผ๋กœ GET ์š”์ฒญ์—์„œ๋Š” ์š”์ฒญ ๋ณธ๋ฌธ(Request Body)์„ ์ „์†กํ•  ์ˆ˜ ์—†๋‹ค.

GET ์š”์ฒญ์—์„œ๋Š” ์š”์ฒญ URI์˜ ์ฟผ๋ฆฌ ๋ฌธ์ž์—ด(Query String)์„ ์‚ฌ์šฉํ•˜์—ฌ ์š”์ฒญ ๋งค๊ฐœ๋ณ€์ˆ˜(Request Parameter)๋ฅผ ์ „๋‹ฌํ•œ๋‹ค.

 

๋”ฐ๋ผ์„œ, ์š”์ฒญ ๋ณธ๋ฌธ์„ ์ „์†กํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ์—๋Š” POST, PUT, DELETE ๋“ฑ์˜ HTTP ์š”์ฒญ ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๊ณ  GET์€ ์ง€์–‘ํ•œ๋‹ค.

 

๐Ÿฐ ๊ทธ๋Ÿฌ๋‚˜!

๊ทธ๋Ÿฌ๋‚˜, ์ผ๋ถ€ API์—์„œ๋Š” GET ์š”์ฒญ์—์„œ๋„ ์š”์ฒญ ๋ณธ๋ฌธ์„ ์ „์†กํ•  ์ˆ˜ ์žˆ๋„๋ก ์ง€์›ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค.

์ด ๊ฒฝ์šฐ์—๋Š” ์š”์ฒญ URI์— ์ฟผ๋ฆฌ ๋ฌธ์ž์—ด ๋Œ€์‹  ์š”์ฒญ ๋ณธ๋ฌธ์„ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์š”์ฒญ์„ ์ „์†กํ•œ๋‹ค.

 

์ด๋Ÿฐ ๊ฒฝ์šฐ์—๋Š” API ๋ฌธ์„œ์—์„œ ํ•ด๋‹น ์š”์ฒญ ๋ฐฉ์‹์„ ๋ช…์‹œํ•˜๊ณ , ์–ด๋–ค ํ˜•์‹์œผ๋กœ ์š”์ฒญ ๋ณธ๋ฌธ์„ ์ „์†กํ•ด์•ผ ํ•˜๋Š”์ง€ ์•ˆ๋‚ดํ•œ๋‹ค.

๊ทธ๋Ÿฌ๋‚˜ ์ด๋Ÿฌํ•œ ๋ฐฉ์‹์€ ์ผ๋ฐ˜์ ์ธ ๊ทœ์•ฝ์ด ์•„๋‹ˆ๋ฏ€๋กœ, API๋ฅผ ํ˜ธ์ถœํ•  ๋•Œ ์š”์ฒญ ๋ฐฉ์‹๊ณผ ์š”์ฒญ ๋ณธ๋ฌธ ์ „์†ก ๋ฐฉ๋ฒ•์„ ๋ฐ˜๋“œ์‹œ ํ™•์ธ์ด ํ•„์š”ํ•˜๋‹ค.

 

์š”์ฒญ ๋ณธ๋ฌธ์„ ์ „์†กํ•  ์ˆ˜ ์—†๋Š” API์—์„œ๋Š” POST, PUT, DELETE ๋“ฑ์˜ ์š”์ฒญ ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์š”์ฒญ์„ ๋ณด๋‚ด์•ผ ํ•œ๋‹ค.

๋ฐ˜์‘ํ˜•