HTTP 303: Difference between revisions
Self-reverting per discussion at Wikipedia talk:Manual of Style#Is "an HTTP" or "a HTTP" correct?. Undid revision 533269914 by Guy Macon (talk) |
|||
Line 1: | Line 1: | ||
{{HTTP}} |
{{HTTP}} |
||
The [[HTTP]] response [[List of HTTP status codes|status code]] '''303 See Other''' is the correct way to redirect web applications to a new [[ |
The [[HTTP]] response [[List of HTTP status codes|status code]] '''303 See Other''' is the correct way to redirect web applications to a new [[Universal Resource Identifier|URI]], particularly after an [[HTTP POST]] has been performed, since RFC 2616 (HTTP 1.1). |
||
This response indicates that the correct response can be found under a different URI and should be retrieved using a GET method. The specified URI is not a substitute reference for the original resource. |
This response indicates that the correct response can be found under a different URI and should be retrieved using a GET method. The specified URI is not a substitute reference for the original resource. |
||
Line 6: | Line 6: | ||
This status code should be used with the [[HTTP location|location]] header, as described below. |
This status code should be used with the [[HTTP location|location]] header, as described below. |
||
'''303 See Other''' has been proposed as one way of responding to a request for a [[ |
'''303 See Other''' has been proposed as one way of responding to a request for a [[Universal Resource Identifier|URI]] that identifies a ''real-world object'' according to [[Semantic Web]] theory (the other being the use of ''hash URIs'').<ref>[http://www.w3.org/TR/cooluris/ Cool URIs for the Semantic Web], see section 4</ref> For example, if http://www.example.com/id/alice identifies a person, Alice, then it would be inappropriate for a server to respond to a GET request with 200 OK, as the server could not deliver Alice herself. Instead the server would issue a 303 See Other response which redirected to a separate URI providing a description of the person Alice. |
||
'''303 See Other''' can be used for other purposes. For example, when building a [[ |
'''303 See Other''' can be used for other purposes. For example, when building a [[representational state transfer|REST]]ful [[web API]] that needs to return to the caller immediately but continue executing asynchronously (such as a long-lived image conversion), the web API can provide a status check URI that allows the original client who requested the conversion to check on the conversion's status. This status check web API should return '''303 See Other''' to the caller when the task is complete, along with a URI from which to retrieve the result in the ''Location'' [[HTTP header]] field.<ref>Subbu Allamaraju. ''RESTful Web Services Cookbook: Solutions for Improving Scalability and Simplicity''. O'Reilly Media, 2010, p. 20.</ref> |
||
==Example== |
==Example== |
||
Line 33: | Line 33: | ||
[[Category:HTTP status codes]] |
[[Category:HTTP status codes]] |
||
{{web-stub}} |
{{web-stub}} |
Revision as of 11:18, 2 March 2013
HTTP |
---|
Request methods |
Header fields |
Response status codes |
Security access control methods |
Security vulnerabilities |
The HTTP response status code 303 See Other is the correct way to redirect web applications to a new URI, particularly after an HTTP POST has been performed, since RFC 2616 (HTTP 1.1).
This response indicates that the correct response can be found under a different URI and should be retrieved using a GET method. The specified URI is not a substitute reference for the original resource.
This status code should be used with the location header, as described below.
303 See Other has been proposed as one way of responding to a request for a URI that identifies a real-world object according to Semantic Web theory (the other being the use of hash URIs).[1] For example, if http://www.example.com/id/alice identifies a person, Alice, then it would be inappropriate for a server to respond to a GET request with 200 OK, as the server could not deliver Alice herself. Instead the server would issue a 303 See Other response which redirected to a separate URI providing a description of the person Alice.
303 See Other can be used for other purposes. For example, when building a RESTful web API that needs to return to the caller immediately but continue executing asynchronously (such as a long-lived image conversion), the web API can provide a status check URI that allows the original client who requested the conversion to check on the conversion's status. This status check web API should return 303 See Other to the caller when the task is complete, along with a URI from which to retrieve the result in the Location HTTP header field.[2]
Example
Client request:
GET / HTTP/1.1 Host: www.example.com
Server response:
HTTP/1.1 303 See Other Location: http://example.org/other
See also
- RFC 2616 (HTTP 1.1)
- RFC 1945 (HTTP 1.0)
- Hypertext Transfer Protocol
- List of HTTP status codes
- Post/Redirect/Get
References
- ^ Cool URIs for the Semantic Web, see section 4
- ^ Subbu Allamaraju. RESTful Web Services Cookbook: Solutions for Improving Scalability and Simplicity. O'Reilly Media, 2010, p. 20.