HTTP Status Codes 302, 303, 307 differences

Source: Internet
Author: User
Tags 303 status code

HTTP status Code 3XX indicates redirection, indicating that the browser needs to perform some special processing to properly process the request.

301 Moved Permanently
Permanent orientation. The status code indicates that the requested resource has been assigned a new URI and should later use the URI that the resource now refers to.

302 Found
Temporary redirection. The status code indicates that the requested resource has been assigned a new URI and that the user (this time) will be able to access it using the new URI. Similar to 301, but 302 represents a resource that is not permanently moved, but is temporary. In other words, the URI of the moved resource may change in the future, for example, if the user saves the URI as a bookmark, but does not update the bookmark as the 301 status code appears, but still retains the URI of the page that returns the 302 status code.

303 See other
The status code indicates that the requested resource is obtained by using the Get method, because another URI exists for the resource that corresponds to the request.
The 303 and 302 status codes have the same functionality, but 303 explicitly indicates that the client should use the Get method to obtain the resource, which differs from the 302 status code.
For example, when you use the Post method to access a CGI program, its execution results in a 303 status code when you want the client to be redirected to another URI with the Get method. Although 302 can achieve the same function, it is ideal to use the 302 status code here.

When the 301, 302, 303 response status codes are returned, almost all browsers will change the post to get and delete the principal within the request message, and the request will be sent again automatically.
301, 302 Standard is to prohibit the post method to change to get method, but the actual use of people will do so.

307 Temporary Redirect
Temporary redirection. The status code has the same meaning as 302. Although the 302 standard prohibits post change get, it is not adhered to when actually used.
307 will follow the browser standard and will not change from post to get. However, various browsers may have different scenarios for the behavior when dealing with responses.

HTTP Status Codes 302, 303, 307 differences

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.