Skip to content

Latest commit

ย 

History

History
60 lines (46 loc) ยท 2.46 KB

HTTP status code.md

File metadata and controls

60 lines (46 loc) ยท 2.46 KB

HTTP status code

ํด๋ผ์šฐ๋“œ ํ™˜๊ฒฝ์—์„œ HTTP API๋ฅผ ํ†ตํ•ด ํ†ต์‹ ํ•˜๋Š” ๊ฒƒ์ด ๋Œ€๋ถ€๋ถ„์ž„

์ด๋•Œ, ์‘๋‹ต ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ํ†ตํ•ด ์„ฑ๊ณต/์‹คํŒจ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ API ๋ฌธ์„œ๋ฅผ ์ž‘์„ฑํ•  ๋•Œ ๊ผญ ์•Œ์•„์•ผ ํ•  ๊ฒƒ์ด HTTP status code๋‹ค


  • 10x : ์ •๋ณด ํ™•์ธ
  • 20x : ํ†ต์‹  ์„ฑ๊ณต
  • 30x : ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ
  • 40x : ํด๋ผ์ด์–ธํŠธ ์˜ค๋ฅ˜
  • 50x : ์„œ๋ฒ„ ์˜ค๋ฅ˜

200๋ฒˆ๋Œ€ : ํ†ต์‹  ์„ฑ๊ณต
์ƒํƒœ์ฝ”๋“œ ์ด๋ฆ„ ์˜๋ฏธ
200 OK ์š”์ฒญ ์„ฑ๊ณต(GET)
201 Create ์ƒ์„ฑ ์„ฑ๊ณต(POST)
202 Accepted ์š”์ฒญ ์ ‘์ˆ˜O, ๋ฆฌ์†Œ์Šค ์ฒ˜๋ฆฌX
204 No Contents ์š”์ฒญ ์„ฑ๊ณตO, ๋‚ด์šฉ ์—†์Œ

300๋ฒˆ๋Œ€ : ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ
์ƒํƒœ์ฝ”๋“œ ์ด๋ฆ„ ์˜๋ฏธ
300 Multiple Choice ์š”์ฒญ URI์— ์—ฌ๋Ÿฌ ๋ฆฌ์†Œ์Šค๊ฐ€ ์กด์žฌ
301 Move Permanently ์š”์ฒญ URI๊ฐ€ ์ƒˆ ์œ„์น˜๋กœ ์˜ฎ๊ฒจ๊ฐ
304 Not Modified ์š”์ฒญ URI์˜ ๋‚ด์šฉ์ด ๋ณ€๊ฒฝX

400๋ฒˆ๋Œ€ : ํด๋ผ์ด์–ธํŠธ ์˜ค๋ฅ˜
์ƒํƒœ์ฝ”๋“œ ์ด๋ฆ„ ์˜๋ฏธ
400 Bad Request API์—์„œ ์ •์˜๋˜์ง€ ์•Š์€ ์š”์ฒญ ๋“ค์–ด์˜ด
401 Unauthorized ์ธ์ฆ ์˜ค๋ฅ˜
403 Forbidden ๊ถŒํ•œ ๋ฐ–์˜ ์ ‘๊ทผ ์‹œ๋„
404 Not Found ์š”์ฒญ URI์— ๋Œ€ํ•œ ๋ฆฌ์†Œ์Šค ์กด์žฌX
405 Method Not Allowed API์—์„œ ์ •์˜๋˜์ง€ ์•Š์€ ๋ฉ”์†Œ๋“œ ํ˜ธ์ถœ
406 Not Acceptable ์ฒ˜๋ฆฌ ๋ถˆ๊ฐ€
408 Request Timeout ์š”์ฒญ ๋Œ€๊ธฐ ์‹œ๊ฐ„ ์ดˆ๊ณผ
409 Conflict ๋ชจ์ˆœ
429 Too Many Request ์š”์ฒญ ํšŸ์ˆ˜ ์ƒํ•œ ์ดˆ๊ณผ

500๋ฒˆ๋Œ€ : ์„œ๋ฒ„ ์˜ค๋ฅ˜
์ƒํƒœ์ฝ”๋“œ ์ด๋ฆ„ ์˜๋ฏธ
500 Internal Server Error ์„œ๋ฒ„ ๋‚ด๋ถ€ ์˜ค๋ฅ˜
502 Bad Gateway ๊ฒŒ์ดํŠธ์›จ์ด ์˜ค๋ฅ˜
503 Service Unavailable ์„œ๋น„์Šค ์ด์šฉ ๋ถˆ๊ฐ€
504 Gateway Timeout ๊ฒŒ์ดํŠธ์›จ์ด ์‹œ๊ฐ„ ์ดˆ๊ณผ