와탭랩스 블로그 오픈 이벤트 😃
자세히 보기
Tech
2024-03-11
Organizing HTTP Status Codes
blog main image

URL Monitoring provided by WhaTap is a service that notifies you of web service failures. If the status code returned from the web service appears as 4xx or 5xx, it is supposed to send a warning alarm. The status code returned by a web service is called an HTTP STATUS CODE, and a typical status code is "404 Not Found".

References W3 RFC 2616 Status Code Summary Jump to Mozilla Foundation Status Code Summary Jump to IETF's RFC 2616 Jump to

The status code is a three-digit number, with the first digit being 1 through 5. If the first digits are 4 and 5, this is information that the site administrator needs to know immediately because it is not normal.

  • 1xx (Information): Your request has been received and will continue with the process.
  • 2xx (Success): Your request was successfully received, recognized, and accepted.
  • 3xx (Redirect): Additional action is required to complete the request.
  • 4xx (Client Error): The request is malformed or the request cannot be processed.
  • 5XX (Server error) : The server failed to fulfill an apparently valid request.

1XX : Information responses

If the status code starts with '1', it means that the server has received the request and the client connected to the server should continue with the operation. This code is not supported in HTTP 1.0.

100 Continue

A response code that means that the request is in progress. It lets you know that you are okay with the progress so far, and that the client can continue to make requests or ignore them if they have already completed their request.

101 Switching Protocol

101 is sent in response to the Upgrade request header sent by the client.

This response code is included in the response to the Upgrade request header sent by the client and indicates that the server will be changing protocols. This code is used when switching Websocket protocols.

102 Processing(WebDAV)

This response code tells the server that it has received the request and is processing it, but cannot give a proper response yet.

2XX : Successful responses

200 OK

The request was successful. The information is returned in response to the request.

201 Created

The request was successful and a new resource was created as a result. This response typically follows a POST request or some PUT requests.

202 Accepted

The request has been received, but cannot be acted upon. This response is not explicit about sending an asynchronous response over HTTP afterward with the results of processing the request. It is intended for situations where another process is handling the request, or the server is handling the request or is a batch process.

203 Non-Authoritative Information

This response code means that the set of meta information returned does not match that of the origin server, but was assembled from a local or third-party copy. Under these conditions, a 200 OK response should always be preferred over this response.

204 No Content

There is no content that can be sent for the request, but the headers can be meaningful. The user-agent can update the headers with new ones when the resource is cached.

205 Reset Content

This response code tells the user agent to reset the document view that sent this request after completing the request.

206 Partial Content

This response code is used because the client sent the Range header in an attempt to split download multiple streams. When the client attempts to take over, the web server responds with '206 Partial Content' and starts sending the partial bytes of data specified in the Range header.

207 Multi-Status

Multi-Status responses convey information when it is appropriate to do so in situations where multiple resources have multiple status codes. These codes are used for Web Distributed Authoring and Vesioning (WebDAV).

208 Already Reported

Prostat (a portmanteau of property and status) response property used to avoid repeatedly enumerating multiple internal members bound to the same collection. This code is used for Web Distributed Authoring and Vesioning (WebDAV).

226 IM Used ( HTTP Delta encoding )

The server has fulfilled its resource obligations for the GET request, and the response indicates that one or more instance operations have been applied to the current instance.

3XX : Redirection messages

300 Multiple Choice

More than one response is possible for a request. The user-antient or user must choose one of them. There is no standardized method for how to choose one of the responses.

301 Moved Permanently

This response code means that the URI of the requested resource has changed. The new URI will probably be given in the response.

302 Found

This response code means that the URI of the requested resource has temporarily changed. The new URI may be created at a later time; therefore, the client must make future requests with the same URI.

303 See Other

The response that the server sends directly to the client when the client needs to get the requested resource via a GET request from a different URI.

304 Not Modified

This is used for caching purposes. This tells the client that the response has not been modified, so the client can still use the cached version of the response.

305 Use Proxy

Defined in older versions of the HTTP technical specification, this indicates that the requested response must be accessed through a proxy. This is becoming obsolete due to security concerns about the in-band setting of proxies.

306 Unused

This response code is deprecated and is currently reserved for future use. It was used in versions prior to the HTTP 1.1 specification.

307 Temporary Redirect

The server sends this response directly to the client when the resource requested by the client is located at a different URI and must be requested using the same method as the previous request. This has the same meaning as the 302 Found HTTP response code, except that the user agent must not change the HTTP method used. If POST was used in the first request, the second request must also use POST.

308 Permanent Redirect

This means that the resource is now located at a permanently different URI, specified in Location: in the HTTP response header. This has the same meaning as the 301 Moved Permanently HTTP response code, except that the user agent MUST NOT change the HTTP method. If POST was used in the first request, the second request MUST use POST.

4XX : Client error responses

400 Bad Request

This response means that the server was unable to understand the request due to incorrect grammar.

401 Unauthorized

Although the HTTP standard clarifies "unauthorized", semantically this response means "unauthenticated". The client must authenticate itself in order to receive the requested response.

402 Payment Required

This response code is reserved for future use. It was initially created for use in digital payment systems, but is not currently in use.

403 Forbidden

The client does not have the right to access the content. For example, they are unauthorized, so the server sends the appropriate response for rejection. The difference with 401 is that the server knows who the client is.

404 Not Found

The server was unable to find the requested resource, which in a browser means an unknown URL. In an API, this might mean that the endpoint is valid, but the resource itself doesn't exist. Servers may send this response instead of a 403 to hide the resource from unauthorized clients. This response code may be the most famous because it occurs repeatedly across the web.

405 Method Not Allowed

The requested method is known to the server, but it has been removed and is not available. For example, an API might prohibit deleting a resource. The required methods GET and HEAD cannot be removed, and this error code cannot be returned.

406 Not Acceptable

This response is sent by the web server when the server has performed server-driven content negotiation and has not found any content that meets the specifications set by the user agent.

407 Proxy Authentication Required

This is similar to 401, but requires authentication completed by a proxy.

408 Request Timeout

This response is sent by some servers to connections that have been making requests for a long time, sometimes even if there have been no requests from the client before. This means that the server wants to disconnect unused connections. This response is seen more frequently in certain browsers, such as Chrome, Firefox 27+, or browsers that use HTTP preconnect mechanisms to speed up web surfing, such as IE 9. Some servers will also disconnect without sending this message.

409 Conflict

This response is sent when a request conflicts with the current state of the server.

410 Gone

This response is sent when the requested content has been permanently deleted from the server, and the address to which it can be forwarded no longer exists. It is expected that the client will clear their cache and links to the resource. The HTTP Technical Specification expects this status code to be used for "temporary, promotional services". The API should not imply that a known resource has been deleted with this status code.

411 Length Required

The server rejects the request because the request does not have the Content-Length header field defined as required by the server.

412 Precondition Failed

The precondition in the client's header is not appropriate for the server's precondition.

413 Payload Too Large

The request entity is larger than the limit defined by the server. The server will either disconnect the connection or return it in the Retry-After header field.

414 URI Too Long

The URI requested by the client is longer than the server is willing to handle.

415 Unsupported Media Type

The requested media type is not supported by the server. The server will reject the request.

416 Requested Range Not Satisfiable

The specified range requested in the Range header field cannot be satisfied. The range is likely outside the size of the target URI data.

417 Expectation Failed

This response code tells the server that the expectation requested in the Expect request header field is not appropriate.

418 I'm a teapot

The server refuses to brew coffee in a teapot.

421 Misdirected Request

A request directed to the server was unable to generate a response. This is sent when the server is unable to generate a response by configuring the scheme and authorization associated with the request URI.

422 Unprocessable Entity (WebDAV)

The request is well-formed, but cannot be honored due to a syntax error.

423 Locked (WebDAV)

The resource is locked from access.

424 Failed Dependency (WebDAV)

The current request failed because the previous request failed.

426 Upgrade Required

The server has declined to process the request using the current protocol, but might do so if the client upgrades to a different protocol. The server sends the Upgrade header and the required protocol in the 426 response.

428 Precondition Required

The origin server requires the request to be conditional. This is to prevent "lost updates," which are conflicts caused by a third party modifying the server's state while the client GETs a resource, modifies it, and PUTs it back to the server.

429 Too Many Requests

The user sent too many requests at the specified time ("rate limiting").

431 Request Header Fields Too Large

The server will not process the request because the requested header fields are too large. The request must be reduced in size and resent.

451 Unavailable For Legal Reasons

와탭 모니터링을 무료로 체험해보세요!