2xx is the status code for successful responses. In a simple simulation, http status code 2xx will provide a successful response, from the server to the client. Available status codes are 200, 201, 202, 203, 204, 205, 206, 207, 208 and 226.
With http 200 status code, the server returns the success status of certain requests via GET, HEAD, POST and TRACE.
The status code 200 is also well-known as the standard response for successful HTTP requests.
Contoh HTTP Status 2xx Status Code: 200
Status code 201 indicates that REQUEST has been fulfilled and generated a NEW RESOURCES or, SERVER must create a certain resource before downloading http status code 201.
Client requests are in the form of POST or PUT.
Contoh HTTP Status 2xx Status Code: 201
Status code 202 indicates that REQUEST has been processed, but this phase has not yet been completed or is still in the process.
Then, why does the server have to return the 202 status if the process hasn't finished yet?
Response 202 is often seen as not committed. But the http status code 202 clearly has a purpose, which is to allow the server to accept other requests.
Contoh HTTP Status 2xx Status Code: 202
HTTP 203 Non-Authoritative Information response status indicates that the CLIENT's request was successful, but the attached file has been modified by a proxy or a third party transforming from the 200 (OK) response on the origin server.
Contoh HTTP Status 2xx Status Code: 203
HTTP 204 responses generally appear in cases of PUT use. Where the server has implemented the client REQUEST, but without changing the content of the current page displayed to the user.
Contoh HTTP Status 2xx Status Code: 204
The status code 205 is a request from the server to the client to reset documents from which the original request was sent. For example, if a user fills out a form, and sends it, the status code 205 means the server asks the browser to delete the form.
Contoh HTTP Status 2xx Status Code: 205
Status code 206 is a response to a request for part of a document. This code is used by advanced caching tools, when the user agent only requests a small portion of the page, only that part is returned.
Contoh HTTP Status 2xx Status Code: 206
The message body that follows by default is an XML message and can contain a number of separate response codes, depending on how many sub-requests are made.
Contoh HTTP Status 2xx Status Code: 207
DAV binding members have been mentioned in the previous response section (multistatus), and are not included again.
Contoh HTTP Status 2xx Status Code: 208
The server has fulfilled the resource request, and the response is a representation of the results of one or more instance manipulations applied to the current instance.
Contoh HTTP Status 2xx Status Code: 226