RFC 9110 - 15. Status Codes

hyungjunn·2024년 7월 14일

15.5. Client Error 4xx

The 4xx (Client Error) class of status code indicates that the client seems to have erred. Except when responding to a HEAD request, the server SHOULD send a representation containing an explanation of the error situation, and whether it is a temporary or permanent condition. These status codes are applicable to any request method. User agents SHOULD display any included representation to the user.

4xx(클라이언트 에러) 는 클라이언트가 에러를 냈다고 가리킨다. HEAD 요청을 응답할 때를 제외하고, 서버는 에러 상황에 대한 설명과 일시적인 상태인지 영구적인 상태인지에 대한 설명이 포함된 표현을 보내야한다. 이러한 상태코드는 어느 요청 메서드에서나 적용가능하다. 유저 에이전트는 포함된 모든 표현을 사용자에게 보여줘야 한다.

15.5.1. 400 Bad Request

The 400 (Bad Request) status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

400(Bad Request) 상태 코드는 클라이언트 에러(예를 들어, 형식에 맞지 않는 요청 문법, 유효하지 않은 요청 메시지 형태 또는 잘못된 요청 라우팅)로 인해 서버가 요청을 처리할 수 없거나 처리하지 않을 것을 나타낸다.

15.5.5. 404 Not Found

The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

404 상태코드는 기존 서버가 URL에 대한 내용을 찾지 못했다는 뜻이다. 즉, 이 에러가 발생했을 때는 제대로된 url이 전달되었는지부터 확인하면 된다.

15.6 Server Error 5xx

The 5xx (Server Error) class of status code indicates that the server is aware that it has erred or is incapable of performing the requested method. Except when responding to a HEAD request, the server SHOULD send a representation containing an explanation of the error situation, and whether it is a temporary or permanent condition. A user agent SHOULD display any included representation to the user. These status codes are applicable to any request method.

5xx (서버 에러)는 서버가 에러다 났거나 요청 메서드를 수행할 수 없다는걸 안다는걸 나타낸다. HEAD request에 응답할 때를 제외하고 서버는 에러 상황에 대한 설명과 일시적인 상태인지 영구적인 상태인지에 대한 설명이 포함된 표현을 전달해야 한다. 유저 에이전트는 포함된 모든 표현을 유저에게 보여줘야 한다. 이러한 상태코드는 모든 요청 메서드에 적용할 수 있다.

15.6.1 500 Internal Server Error

The 500 (Internal Server Error) status code indicated that the server encountered an enexpected condition that prevented it from fulfilling the request.

500 (Internal Server Error) 상태 코드는 서버가 요청을 처리할 수 없는 예기치 않는 상태가 발생했을을 나타낸다.

  • fulfilling the request: 요청을 충족시키는 것 -> 요청을 수행하는 것
  • prevented it: 그것이 ~을 방해하다

15.5.7 406 Not Acceptable

The 406 (Not Acceptable) status code indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotation header fields recieved in the request(Section 12.1), and the server is unwilling to supply a default representation.

406 (허용되지 않음) 상태 코드는 요청에 수신된 사전 협상 헤더 필드에 따라 대상(내가 원하는) 리소스가 사용자 에이전트가 수용할 수 있는 현재 표현을 갖고 있지 않음을 나타내고, 서버가 기본 표현을 제공하지 않으려 한다는 것을 나타낸다.

-> 즉, 서버가 정의된 표현을 제공하지 않고 있다는 걸 나타내는 상태코드이다.

The server SHOULD generate content containing a list of available representation characteristics and corresponding resource identifiers from which the user or user agent can choose the one most appropriate. A user agent MAY automatically select the most appropriate choice from that list. However, this specification does not define any standard form such automatic selection, as described in Section 15.4.1.

서버는 이용가능한 표현 문자 목록을 포함하고 유저 또는 가장 적절한것을 고를 수 있는 유저 에이전트로부터의 자원 식별자와 상응하는 내용을 생성해야 한다. 유저 에이전트는 그 리스트로부터 가장 적절한 선택을 자동적으로 선택할지도 모른다. 그러나, 이 명세는 섹션 15.4.1에서 설명하는 바와 같이 자동적인 선택을 어느 표준 형태로 정의하지 않는다.

참고. user agent란? 일반적으로 요청을 보내고 응답을 받는 방식으로 웹 서버와 상호작용하는 모든 클라이언트 소프트웨어를 의미한다.


reference:
RFC 9110 - HTTP Semantics 15. Status Codes

0개의 댓글