Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does HTTP 302 work?

How does HTTP 302 work? I would like to know the internals

like image 373
GilliVilla Avatar asked Jul 28 '10 19:07

GilliVilla


People also ask

Does a 302 automatically redirect?

If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.

What is a 302 HTTP response?

The HyperText Transfer Protocol (HTTP) 302 Found redirect status response code indicates that the resource requested has been temporarily moved to the URL given by the Location header.

What causes a HTTP 302?

What is an HTTP 302? The 302 status code is a redirection message that occurs when a resource or page you're attempting to load has been temporarily moved to a different location. It's usually caused by the web server and doesn't impact the user experience, as the redirect happens automatically.

Does a 302 change URL?

Whereas a 301 redirect is a permanent relocation of your URL, a 302 redirect is a temporary change that redirects both users and search engines to the desired new location for a limited amount of time, until the redirect is removed.


1 Answers

You mean how do browsers handle it? The server sends a 302 code along with a Location header, and the browser requests the new URI specified by the Location header instead.

Unlike 301 (Moved Permanently), the browser continues to use the original URI to do requests, in case the 302 code goes away

like image 110
Michael Mrozek Avatar answered Oct 02 '22 14:10

Michael Mrozek