✊ 필오의 개발일지
Back to Posts
2019년 8월 17일

HTTP 메세지 - 상태코드

HTTP 메세지 - 상태코드

출처: http-decision-diagram 


상태코드와 사유구절

상태코드 (HTTP/1.1 기준)

정보성 상태 코드 (100 - 199)

100 - Continue

클라이언트와 100 Continue

Expect: 100-continue

Expect 

서버와 100 Continue

서버가 100 Continue 값이 담긴 expect 헤더가 포함된 요청을 받는다면

받은 엔터티에 대한 최종 응답코드는 보내줘야 한다.

  1. 클라: 서버에게 expect 헤더 보냄
  2. 서버: 음! 받을 수 있으니, 100을 보내야겠군
  3. 클라: 왜 안 오지 그냥 entity 보내자.
  4. 서버: 음? 100 아직 안보냈는데 entity가 왔네. 걍 받자
  5. 서버: 잘 받았어 ~ 응답 보내줘야 함

프락시와 100 Continue

  1. 클라: 서버에게 expect 헤더 보냄
  2. 프락시: 서버에게 expect 헤더 고대로 보냄
    1. 만약 다음 홉서버가(next-hope) HTTP/1.1 이전 버전이라는 걸 알게 되면 417 Expectation Failed를 클라에게 응답한다.

101 - switching protocols

아래는 upgrade 헤더의 웹소켓으로 서버가 프로토콜을 바꿨다는 의미이다.

HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade

성공 상태 코드 (200 - 299)

200 - OK

201 - Created

202 - Accepted

203 - Non-Authoritative Information

204 - No Content

일반적인 사용 사례는

205 - Reset Content

206 - Partial Content

리다이렉션 상태 코드 (300 - 399)

300 - Multiple Choices

일반적인 사용 사례는

301 - Moved Permanently

302 - Found

303 - See Other

304 - Not Modified

305 - Use Proxy

306 - 사용되지 않음

307 - Temporary Redirect

308 - Permanent Redirect


클라이언트 에러 상태 코드 (400 - 499)

400 - Bad Request

401 - Unauthorized

402 - Payment Required

403 - Forbidden

404 - Not Found

405 - Method Not Allowed

406 - Not Acceptable

407 - Proxy Authentication Required

408 - Request Timeout

409 - Conflict

410 - Gone

411 - Length Required

412 - Precondition Failed

413 - Payload Too Large (Request Entity Too Large)

2. 414 - URI Too Long (Request URI Too Long)

415 - Unsupported Media Type

416 - Range Not Satisfiable

417 - Expectation Failed

418 - I’m a teapot

422 - Unprocessable Entity

425 - Too Early

426 - Upgrade Required

428 - Precondition Required

429 - Too Many Requests

3. 431 - Request Header Fields Too Large


서버 에러 상태 코드 (500 - 599)

500 - Internal Server Error

501 - Not Implemented

502 - Bad Gateway

1. 503 - Service Unavailable

504 - Gateway Timeout

505 - 02. HTTP Version Not Supported

511 - 02. Network Authentication Required



참고자료

  1. MDN 
PreviousHTTP 메세지 - 헤더
NextHTTP 메세지 - 메서드

Related

© 2025 Felix