Contents

Http Status Code Overview

Reference: https://www.restapitutorial.com/httpstatuscodes.html

⭐︎ -> “Top 10” HTTP Status Code. More REST service-specific information is contained in the entry.

1XX Information

  • 100 continue – Client should continue
  • 101 switching protocols
  • 102 processing (webDAV)

2XX Success

  • ⭐︎200 OK – The request has succeeded.

    General status code. Most common code used to indicate success.

  • ⭐︎201 Created – A new resource has been created and should return a URI.

    Successful creation occurred (via either POST or PUT). Set the Location header to contain a link to the newly-created resource (on POST). Response body content may or may not be present.

  • 202 Accepted
  • 203 Non-Authoritative Information
  • ⭐︎204 No Content – The server successfully processed the request, but is not returning any content.

    Status when wrapped responses (e.g. JSEND) are not used and nothing is in the body (e.g. DELETE).

  • 205 Reset Content
  • 206 Partial Content
  • 207 Multi-Status(webDAV)
  • 208 Already Reported (WebDAV)
  • 226 IM Used

3XX Redirection

  • 300 Multiple Choices
  • 301 Moved Permanently
  • 302 Found – 303 + 307
  • 303 See Other – The response to the request can be found under another URI using a GET method.
  • ⭐︎304 Not Modified – The resource has not been modified since last requested. Typically, the HTTP client provides a header like the If-Modified-Since header to provide a time against which to compare and you can use previous resource.

    Used for conditional GET calls to reduce band-width usage. If used, must set the Date, Content-Location, ETag headers to what they would have been on a regular GET call. There must be no body on the response.

  • 305 Use Proxy
  • 306 (Unused) – Used in old version
  • 307 Temporary Redirect – the request should be repeated with another URI; however, future requests can still use the original URI.
  • 308 Permanent Redirect (experimental)

4XX Client Error

  • ⭐︎400 Bad Request – The request cannot be fulfilled due to bad syntax.

    General error when fulfilling the request would cause an invalid state. Domain validation errors, missing data, etc. are some examples.

  • ⭐︎401 Unauthorize – Similar to 403 Forbidden, but specifically for use when authentication is possible but has failed or not yet been provided.

    Error code response for missing or invalid authentication token.

  • 402 Payment Required

  • ⭐︎403 Forbidden – The server understood the request, but is refusing to fulfill it. It SHOULD describe the reason for the refusal in the entity.

    Error code for user not authorized to perform the operation or the resource is unavailable for some reason (e.g. time constraints, etc.).

  • ⭐︎404 Not Found – The requested resource could not be found or just don’t want to tell you the reason for the refusal.

    Used when the requested resource is not found, whether it doesn’t exist or if there was a 401 or 403 that, for security reasons, the service wants to mask.

  • 405 Method Not Allowed

  • 406 Not Acceptable

  • 407 Proxy Authentication Required

  • 408 Request Timeout

  • ⭐︎409 Conflict – Indicates that the request could not be processed because of conflict in the request, such as an edit conflict.(version control)

    Whenever a resource conflict would be caused by fulfilling the request. Duplicate entries and deleting root objects when cascade-delete is not supported are a couple of examples.

  • 410 Gone – The resource requested is no longer available and will not be available again.

  • 411 Length Required

  • 412 Precondition Failed

  • 413 Request Entity Too Large

  • 414 Request-URI Too Long

  • 415 Unsupported Media Type

  • 416 Requested Range Not Satisfiable – The client has asked for a portion of the file, but the server cannot supply that portion.

  • 417 Expectation Failed

  • 418

  • 420

  • 422

  • 423

  • 424

  • 425

  • 426

  • 428

  • 431

  • 444

  • 449

  • 450

  • 451

  • 499

5XX Server Error

  • ⭐︎500 Internal Server Error – A generic error message, given when no more specific message is suitable.

    The general catch-all error when the server-side throws an exception.

  • 501 Not Implemented – The server does not support the functionality
  • 502 Bad Gateway – The server was acting as a gateway or proxy and received an invalid response from the upstream server.
  • 503 Service Unavailable
  • 504 Gateway Timeout
  • 505 HTTP Version Not Supported
  • 506 Variant Also Negotiates (Experimental)
  • 507 Insufficient Storage (WebDAV)
  • 508 Loop Detected (WebDAV)
  • 509 Bandwidth Limit Exceeded (Apache)
  • 510 Not Extended
  • 511 Network Authentication Required – The client needs to authenticate to gain network access. Intended for use by intercepting proxies used to control access to the network
  • 598 Network read timeout error
  • 599 Network connect timeout error