HOME

TheInfoList



OR:

The
HTTP HTTP (Hypertext Transfer Protocol) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, wher ...
response status code 302 Found is a common way of performing
URL redirection URL redirection, also called URL forwarding, is a World Wide Web technique for making a web page available under more than one URL address. When a web browser attempts to open a URL that has been redirected, a page with a different URL is opened. ...
. The HTTP/1.0 specification () initially defined this code, and gave it the description phrase "Moved Temporarily" rather than "Found". An HTTP response with this status code will additionally provide a
URL A uniform resource locator (URL), colloquially known as an address on the Web, is a reference to a resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identi ...
in the header field
Location In geography, location or place is used to denote a region (point, line, or area) on Earth's surface. The term ''location'' generally implies a higher degree of certainty than ''place'', the latter often indicating an entity with an ambiguous bou ...
. This is an invitation to the
user agent On the Web, a user agent is a software agent responsible for retrieving and facilitating end-user interaction with Web content. This includes all web browsers, such as Google Chrome and Safari A safari (; originally ) is an overland jour ...
(e.g. a web browser) to make a second, otherwise identical, request to the new URL specified in the location field. The end result is a redirection to the new URL. Many web browsers implemented this code in a manner that violated this standard, changing the request type of the new request to GET, regardless of the type employed in the original request (e.g. POST). For this reason, HTTP/1.1 () added the new status codes 303 and 307 to disambiguate between the two behaviours, with 303 mandating the change of request type to GET, and 307 preserving the request type as originally sent. Despite the greater clarity provided by this disambiguation, the 302 code is still employed in web frameworks to preserve compatibility with browsers that do not implement the HTTP/1.1 specification. As a consequence, (the update of ) changes the definition to allow user agents to rewrite POST to GET.


Example

Client request: GET /index.html HTTP/1.1 Host: www.example.com Server response: HTTP/1.1 302 Found Location: http://www.iana.org/domains/example/


See also

*
List of HTTP status codes Hypertext Transfer Protocol (HTTP) response status codes are issued by a server in response to a client's request made to the server. It includes codes from IETF Request for Comments (RFCs), other specifications, and some additional codes us ...
* HTTP 301


References


External links

* {{IETF RFC, 9110, link=no HTTP Semantics Hypertext Transfer Protocol status codes