HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
State Code
첫 번째 숫자는 HTTP 응답의 종류 구분을 나머지 두 개의 숫자는 세부적인 응답 내용 구분을 위해 사용
- State Code는 응답의 상태를 분류해준다.
- 100-599 까지의 숫자를 사용한다
- 100-199 Informational Response(정보 응답)
- 200-299 Successful Response(성공 응답)
- 300-399 Redirection Message(리다이렉션 메세지)
- 400-499 Client Error Response(클라이언트 에러 응답)
- 500-599 Server Error Response(서버 에러 응답)
주요 State Code 정리
200(OK)
- 문제없이 요청이 잘 실행됨201(Created)
- 문제없이 데이터 생성이 잘 됨 (POST 요청에서 많이 사용)202(Accepted)
- 요청은 접수하였지만, 처리가 완료되지 않음301(Moved Permanently)
- 리소스가 영구적으로 이동됨400(Bad Request)
- 요청이 잘못됨(필수 값 부족 등)401(Unauthorized)
- 인증 토큰/키가 잘못됨403(Forbidden)
- 접근 불가능한 리소스, 401과 달리 인증은 된 상태404(Not Found)
- 존재하지 않은 리소스405(Method Not Allowed)
- 허가되지 않은 요청 Method500(Internal Server Error)
-알 수 없는 서버 에러