Status Codes

A status code consists of three digits. The first digit defines the class of a response. There are five values for the first digit:

  • 1xx: indication information, indicating that the request has been received and can be further processed.

  • 2xx: success, indicating that the request has been received, understood, and accepted.

  • 3xx: redirection, indicating that the request requires further operations before it can be completed.

  • 4xx: client error, indicating that there is a syntax error in the request or the request cannot be implemented.

  • 5xx: server error, indicating that the server has failed to implement a valid request.

Table 1 describes status codes.

Table 1 Status codes

Status Code

Message

Description

100

Continue

The client should continue with its request.

This interim response is used to inform the client that part of the request has been received and has not yet been rejected by the server.

101

Switching Protocols

The protocol should be switched. The protocol can only be switched to a newer protocol.

For example, the current HTTP protocol is switched to a later version of HTTP.

200

OK

The request has been fulfilled.

201

Created

The request has been fulfilled and a new resource has been created.

202

Accepted

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

203

Non-Authoritative Information

The server has successfully processed the request, but is returning information that may be from another source.

204

NoContent

The request has been fulfilled, but the HTTP response does not contain a response body.

The status code is returned in response to an HTTPS OPTIONS request.

205

Reset Content

The server has fulfilled the request, but the requester is required to reset the content.

206

Partial Content

The server has successfully processed the partial GET request.

300

Multiple Choices

There are multiple options for the location of the requested resource. The response contains a list of resource characteristics and addresses from which the user or user agent (such as a browser) can choose the most appropriate one.

301

Moved Permanently

The requested resource has been assigned a new permanent URI, and the new URI is contained in the response.

302

Found

The requested resource resides temporarily under a different URI.

303

See Other

The response to the request can be found under a different URI, and should be retrieved using a GET or POST method.

304

Not Modified

The requested resource has not been modified. When the server returns this status code, it does not return any resources.

305

Use Proxy

The requested resource is available only through a proxy.

306

Unused

The HTTP status code is no longer used.

400

BadRequest

The request is invalid.

The client should not repeat the request without modifications.

401

Unauthorized

This status code is returned after the client provides the authentication information, indicating that the authentication information is incorrect or invalid.

402

Payment Required

This status code is reserved for future use.

403

Forbidden

The server understood the request, but is refusing to fulfill it.

The client should not repeat the request without modifications.

404

NotFound

The requested resource cannot be found.

The client should not repeat the request without modifications.

405

MethodNotAllowed

The method specified in the request is not supported for the requested resource.

The client should not repeat the request without modifications.

406

Not Acceptable

The server cannot fulfill the request according to the content characteristics of the request.

407

Proxy Authentication Required

This status code is similar to 401, but indicates that the client must first authenticate itself with the proxy.

408

Request Time-out

The server has timed out waiting for the request.

The client may repeat the request without modifications at a later time.

409

Conflict

The request could not be processed due to a conflict with the current state of the resource.

This status code indicates that the resource that the client is attempting to create already exists, or that the request has failed to be processed because of the update of the conflict request.

410

Gone

The requested resource has been deleted permanently and is no longer available.

411

Length Required

The server is refusing to process the request without a defined Content-Length.

412

Precondition Failed

The server did not meet one of the preconditions that the requester put on the request.

413

Request Entity Too Large

The server is refusing to process a request because the request entity is too large for the server to process. The server may close the connection to prevent the client from continuing the request. If the server is only temporarily unable to process the request, the response will contain a Retry-After header field.

414

Request-URI Too Large

The Request-URI is too long for the server to process.

415

Unsupported Media Type

The server is unable to process the media format in the request.

416

Requested range not satisfiable

The requested range is invalid.

417

Expectation Failed

The server has failed to meet the requirements of the Expect request-header field.

422

UnprocessableEntity

The request is well-formed but cannot be processed due to semantic errors.

429

TooManyRequests

The client has sent excessive number of requests to the server within a given time (exceeding the limit on the access frequency of the client), or the server has received an excessive number of requests within a given time (beyond its processing capability). In this case, the client should resend the request after the time specified in the Retry-After header of the response has elapsed.

500

InternalServerError

The server is able to receive the request but unable to understand it.

501

Not Implemented

The server does not support the function required to fulfill the request.

502

Bad Gateway

The server was acting as a gateway or proxy and received an invalid request from the remote server.

503

ServiceUnavailable

The requested service is invalid.

The client should not repeat the request without modifications.

504

ServerTimeout

The request cannot be fulfilled within a given time. This status code is returned to the client only if the Timeout parameter is specified in the request.

505

HTTP Version not supported

The server does not support the HTTP protocol version used in the request.