B.2 Success Status Codes

The status codes in the 200 299 range are all success responses of some kind or another. Not all successes are equal, however, and often clients need to know exactly how a request succeeded.

B.2.1 200 OK

200 OK is the basic success code for responses that are accompanied with a body. Whenever a basic GET request is successful, this code is used to return the resource's body.

Defined in HTTP/1.1.

B.2.2 201 Created

201 Created is used to indicate that the server created a new resource as a result of the request. PUT, MKCOL, LOCK, and COPY all return 201 Created when a new resource is created. This status response does not typically have a body, but it may.

Defined in HTTP/1.1.

B.2.3 202 Accepted

202 Accepted was defined for operations that are requested now but may not take place until later, such as documents submitted to an acceptance process that takes human intervention. Neither HTTP nor WebDAV commonly uses this.

Defined in HTTP/1.1.

B.2.4 203 Non-Authoritative Information

203 Non-Authoritative Information can replace 200 OK when the server might not be responding with the most up-to-date and correct resource body or headers. This is not frequently seen in practice.

Defined in HTTP/1.1.

B.2.5 204 No Content

204 No Content is a basic success code, like 200 OK, but the response has no body. This could be the case, for example, where a GET request is issued for a resource that exists but has an empty body. It is used more commonly in WebDAV, for success responses to methods like COPY and MOVE, where there is no information to be returned in the body.

Defined in HTTP/1.1.

B.2.6 205 Reset Content

205 Reset Content is intended to be used when a server has accepted some input on a resource and the client should refresh its view of that resource as a result. It could theoretically be very useful in submission of Web forms, but it is not used in practice.

Defined in HTTP/1.1.

B.2.7 206 Partial Content

200 Partial Content is used very much like the 200 OK status code, except that it is used when not all the available information was returned. For example, the client could request only the first 1000 bytes of a page using the Accept-Range header, and this response would indicate a successful fulfillment of that partial request.

Defined in HTTP/1.1.

B.2.8 207 Multi-Status

207 Multi-Status responses indicate that the response contains one or more response codes inside its body text. These response codes may refer to multiple resources, with the URLs to those resources also inside the body text. This is most useful in responding to requests that address multiple resources.

Many WebDAV servers return 207 Multi-Status even when only one status code is in the body. For example, the server may consistently prepare 207 Multi-Status bodies for every PROPFIND response, in case there is a need for more than one status code. Even when only one status code is required, the 207 Multi-Status response is already prepared and might as well be sent.

Defined in WebDAV.



WebDAV. Next Generation Collaborative Web Authoring
WebDAV. Next Generation Collaborative Web Authoring
ISBN: 130652083
EAN: N/A
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net