About HTTP status Code 204 understanding

Source: Internet
Author: User
Tags response code

There are a number of HTTP status codes, mainly 1xx (temporary response), 2xx (Success), 3xx (redirected), 4xx (Request error), and 5xx (server error) Five large categories, each large class also corresponds to some specific classification. Usually we contact more is 200, 400, 500 and so on.

Here we mainly discuss the status Code 204, in HTTP RFC 2616, the description of 204 is as follows:

If the client is a user agent, it should isn't the change of its document view from this which caused the request to be sent. This response was primarily intended to allow input for actions to take place without causing a change to the user agent ' s Active Document view, although any new or updated metainformation should is applied to the document currently in the user Agent ' s active view.

The meaning is equal to the successful execution of the request, but without the data, the browser does not have to refresh the page . How to understand this passage. Let's say it by example, assuming there's a form on the page, Submit the URL is http-204.htm, submit form, under normal circumstances, the page will jump to http-204.htm, but if the corresponding status code of http-204.htm is 204, then the page will not happen to jump, or stay on the current page. Also for a tag, if the link page response code is 204, the page will not jump.

Therefore, for some data submitted to the server processing, only need to return the success of the case, you can consider using the status code 204来 as the return information, thereby eliminating the unnecessary data transfer.

About HTTP status Code 204 understanding

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.