HTTP Status Code

HTTP Status Code

May 25, 2024 | seedling, permanent

tags :

HTTP Status Codes #

ref Informational responses (100–199) Successful responses (200–299) Redirects (300–399) Client errors (400–499) Server errors (500–599)

ref

5xx #

502 #

Bad gateway, when revere proxy like API gateway is not able to reach the backend servers

  • 502 Bad Gateway server error response code indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server.

mozilla ref

503 #

ref A 503 Service Unavailable Error is an HTTP response status code indicating that a server is temporarily unable to handle the request. This may be due to the server being overloaded or down for maintenance.

4xx #

400 (Bad request) #

  • validations of input request, syntax or missing data points
  • The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. ref

401 (Unauthorized) #

When the client provides no credentials or invalid credentials.

403 (Forbidden) #

Credentials are right, but not allowed to access the resource.

405 #

Method not allowed, e.g.: when using POST method when only GET method is allowed for the URL.

409 (Conflict) #

  • The request could not be completed due to a conflict with the current state/internal state of the resource.
  • This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request.
  • Ideally, the response entity would include enough information for the user or user agent to fix the problem; however, that might not be possible and is not required. ref

3xx #

2xx #

200 (request succeeded) #

The request has succeeded. The information returned with the response is dependent on the method used in the request, for example:

GET an entity corresponding to the requested resource is sent in the response; HEAD the entity-header fields corresponding to the requested resource are sent in the response without any message-body; POST an entity describing or containing the result of the action; TRACE an entity containing the request message as received by the end server.

201 (created) #

  • The request has been fulfilled and resulted in a new resource being created.
  • The newly created resource can be referenced by the URI(s) returned in the entity of the response, with the most specific URI for the resource given by a Location header field.
  • The response SHOULD include an entity containing a list of resource characteristics and location(s) from which the user or user agent can choose the one most appropriate.
  • The entity format is specified by the media type given in the Content-Type header field.
  • The origin server MUST create the resource before returning the 201 status code.
  • If the action cannot be carried out immediately, the server SHOULD respond with 202 (Accepted) response instead.

202 (request accepted) #

The request has been accepted for processing, but the processing has not been completed.

204 (request fulfilled, no response) #

  • The server has fulfilled the request but does not need to return an entity-body, and might want to return updated meta-information.
  • The response MAY include new or updated metainformation in the form of entity-headers, which if present SHOULD be associated with the requested variant.

205 (reset content) #

  • The server has fulfilled the request and the user agent SHOULD reset the document view which caused the request to be sent.
  • This response is primarily intended to allow input for actions to take place via user input, followed by a clearing of the form in which the input is given so that the user can easily initiate another input action.
  • The response MUST NOT include an entity.

206 (partial content) #

  • The server has fulfilled the partial GET request for the resource.
  • The request MUST have included a Range header field (section 14.35) indicating the desired range, and MAY have included an If-Range header field (section 14.27) to make the request conditional.
  • e.g.

    In HLS Format videos will be delivered partially to the client, browser, in multiple segments - each segment with 206 response.


Links to this note

Go to random page

Previous Next