ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

CS/Network

[๋„คํŠธ์›Œํฌ] HTTP์˜ Method์™€ ์ƒํƒœ์ฝ”๋“œ

๊ฐœ๋ฐœ๊ฐœ๊ตด๐Ÿธ 2022. 6. 12. 19:58

HTTP๋ž€?

https://j-su2.tistory.com/16

 

[๋„คํŠธ์›Œํฌ] HTTP์™€ HTTPS

HTTP๋ž€? Hyper Text Transfer Protocol์˜ ์•ฝ์ž๋กœ, ์ธํ„ฐ๋„ท์—์„œ ํ…Œ์ดํ„ฐ๋ฅผ ์ฃผ๊ณ ๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ํ”„๋กœํ† ์ฝœ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ์ฆ‰, ์›น ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ ๊ฐ„์˜ ๋ฌธ์„œ๋ฅผ ๊ตํ™˜ํ•˜๊ธฐ ์œ„ํ•œ ํ†ต์‹  ๊ทœ์•ฝ์ž…๋‹ˆ๋‹ค. - HTTP๋Š” Request์™€ R

j-su2.tistory.com

 

HTTP์˜ ๋™์ž‘

ํด๋ผ์ด์–ธํŠธ๊ฐ€ ๋ธŒ๋ผ์šฐ์ €์˜ URL์„ ํ†ตํ•ด ํŠน์ • Request๋ฅผ ๋ณด๋‚ด๋ฉด, ์„œ๋ฒ„๋Š” ํ•ด๋‹น Request๋ฅผ ๋ฐ›์•„ ์ฒ˜๋ฆฌํ•˜์—ฌ ํด๋ผ์ด์–ธํŠธ์—๊ฒŒ Response๋ฅผ ๋ณด๋‚ด๋Š” ํ˜•ํƒœ๋กœ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค.

HTTP์˜ Method

** ์ตœ๊ทผ HTTP API๋ฅผ ๋งŒ๋“ค๋•Œ GET, POST, PUT, DELETE 4๊ฐ€์ง€ Method๋ฅผ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š” Rest API๊ฐ€ ์ถ”์„ธ์ž…๋‹ˆ๋‹ค.

 

HTTP์˜ Status Code

- 1xx: ์ฒ˜๋ฆฌ์ค‘์œผ๋กœ, ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ์„ ๊ทธ๋Œ€๋กœ ๊ณ„์†ํ•˜๊ฑฐ๋‚˜ ์„œ๋ฒ„์˜ ์ง€์‹œ์— ๋”ฐ๋ผ ํ”„๋กœํ† ์ฝœ์„ ์—…๋ฐ์ดํŠธ ํ•˜์—ฌ ์žฌ์ „์†ก

- 2xx: ์š”์ฒญ ์„ฑ๊ณต

- 3xx: ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ

- 4xx: ํด๋ผ์ด์–ธํŠธ ์—๋Ÿฌ

- 5xx: ์„œ๋ฒ„ ์—๋Ÿฌ

 

๋งŽ์ด ์‚ฌ์šฉ๋˜๋Š” Status Code๋“ค

- 200: Ok (์š”์ฒญ์ด ์„ฑ๊ณต)

- 201: Created(๋ฆฌ์†Œ์Šค ์ž‘์„ฑ ์„ฑ๊ณต)

- 301: Moved Permanently(๋ฆฌ์†Œ์Šค์˜ ์˜๊ตฌ์ ์ธ ์ด๋™)

- 400: Bad Request(์š”์ฒญ ์˜ค๋ฅ˜)

- 401: Unauthorized (์ ‘๊ทผ ๊ถŒํ•œ ์—†์Œ, ์ธ์ฆ ์‹คํŒจ)

- 404: Not found(๋ฆฌ์†Œ์Šค ์—†์Œ)

- 500: internal server error (์„œ๋ฒ„ ๋‚ด๋ถ€ ์—๋Ÿฌ)

- 503: service unavailable(์„œ๋น„์Šค ์ •์ง€)

 

** ๊ฐœ๋ฐœ ์ค‘์ธ ์›น ์„œ๋น„์Šค๋‚˜ ์›น API์—์„œ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์„ ๋•Œ, ์–ด๋–ค ์Šคํ…Œ์ดํ„ฐ์Šค ์ฝ”๋“œ๋ฅผ ๋ฐ˜ํ™˜ํ• ์ง€ ๊ฒฐ์ •ํ•˜๋Š” ๊ฒƒ์€ ์ค‘์š”ํ•œ ์„ค๊ณ„ ๊ฒ€ํ† ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค.

 

 

https://github.com/devsungmin/Ready-For-Tech-Interview/blob/master/Network/HTTP%EB%8F%99%EC%9E%91%EA%B3%BC%EC%A0%95%EA%B3%BC%20HTTP%20Method%2C%20%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C.md

 

GitHub - devsungmin/Ready-For-Tech-Interview: ๐Ÿ’ป ์‹ ์ž… ๊ฐœ๋ฐœ์ž๋กœ์„œ ์ค€๋น„๋ฅผ ํ•˜๊ธฐ ์œ„ํ•ด ์ง€์‹์„ ์ •๋ฆฌํ•˜๋Š” ๊ณต๊ฐ„

๐Ÿ’ป ์‹ ์ž… ๊ฐœ๋ฐœ์ž๋กœ์„œ ์ค€๋น„๋ฅผ ํ•˜๊ธฐ ์œ„ํ•ด ์ง€์‹์„ ์ •๋ฆฌํ•˜๋Š” ๊ณต๊ฐ„ ๐Ÿ‘จ‍๐Ÿ’ป. Contribute to devsungmin/Ready-For-Tech-Interview development by creating an account on GitHub.

github.com

์ถœ์ฒ˜ : ์›น ๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ ์›น์„ ์ง€ํƒฑํ•˜๋Š” ๊ธฐ์ˆ