HTTP response status codes are an essential part of web communication, providing valuable information about the outcome of a client’s request.
In our previous blog posts, we explored Informational Responses (100 – 199) and learned how they establish communication and signal the progress of a request.
Now, let’s dive into the second class of HTTP response status codes – Successful Responses (200 – 299). These codes indicate that the client’s request was successfully received, understood, and accepted by the server. Join us as we explore each of these successful responses in detail.
Table: HTTP Response Status Codes – Successful Responses
Status Code | Name | Description | Example |
---|---|---|---|
200 | OK | The request was successful, and the server sends the requested data in the response body. | HTTP/1.1 200 OK |
201 | Created | The request was successful, and the server has created a new resource as a result. | HTTP/1.1 201 Created |
202 | Accepted | The server has accepted the request for processing, but the processing is not yet complete. | HTTP/1.1 202 Accepted |
203 | Non-Authoritative Information | The server successfully processed the request, but the returned information may be from a different source. | HTTP/1.1 203 Non-Authoritative Information |
204 | No Content | The request was successful, but there is no data to return (e.g., for DELETE requests). | HTTP/1.1 204 No Content |
205 | Reset Content | The server instructs the client to reset the document view, which is often used after form submissions. | HTTP/1.1 205 Reset Content |
206 | Partial Content | The server successfully fulfilled a partial GET request, returning only a portion of the requested data. | HTTP/1.1 206 Partial Content |
207 | Multi-Status | The server has completed a multi-status response, providing information about multiple independent operations. | HTTP/1.1 207 Multi-Status |
208 | Already Reported | The members of a DAV binding have already been enumerated in a previous response, and are not being included again. | HTTP/1.1 208 Already Reported |
226 | IM Used | The server successfully fulfilled a request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance. | HTTP/1.1 226 IM Used |
HTTP 2xx Status Codes (Successful Responses):
- 200 OK:
- Description: The request was successful, and the server sends the requested data in the response body.
- Example:
HTTP/1.1 200 OK
- 201 Created:
- Description: The request was successful, and the server has created a new resource as a result.
- Example:
HTTP/1.1 201 Created
- 202 Accepted:
- Description: The server has accepted the request for processing, but the processing is not yet complete.
- Example:
HTTP/1.1 202 Accepted
- 203 Non-Authoritative Information:
- Description: The server successfully processed the request, but the returned information may be from a different source.
- Example:
HTTP/1.1 203 Non-Authoritative Information
- 204 No Content:
- Description: The request was successful, but there is no data to return (e.g., for DELETE requests).
- Example:
HTTP/1.1 204 No Content
- 205 Reset Content:
- Description: The server instructs the client to reset the document view, which is often used after form submissions.
- Example:
HTTP/1.1 205 Reset Content
- 206 Partial Content:
- Description: The server successfully fulfilled a partial GET request, returning only a portion of the requested data.
- Example:
HTTP/1.1 206 Partial Content
- 207 Multi-Status:
- Description: The server has completed a multi-status response, providing information about multiple independent operations.
- Example:
HTTP/1.1 207 Multi-Status
- 208 Already Reported:
- Description: The members of a DAV binding have already been enumerated in a previous response, and are not being included again.
- Example:
HTTP/1.1 208 Already Reported
- 226 IM Used:
- Description: The server successfully fulfilled a request for the resource, and the response is a representation of the result of one or more instance manipulations applied to the current instance.
- Example:
HTTP/1.1 226 IM Used
Successful responses (status codes 200 – 299) indicate that the client’s request was successfully received, understood, and processed by the server. These codes are crucial for indicating the positive outcome of various types of requests, such as data retrieval, resource creation, and more.
As a developer, understanding these successful response codes helps in handling successful requests appropriately, interpreting returned data, and ensuring a smooth user experience.
Next, we’ll delve into the world of Redirection Responses (300 – 399), which signal that further action is needed to complete the request. Happy coding!
Visit Techtalkbook to find more related topics.
Pingback: Macronimous Blog | Essential HTTP Status Codes Every web Programmer Should Know