Does the HTTP status code affect the content displayed in the browser?

Source: Internet
Author: User
Does the HTTP status code affect the content displayed in the browser? For example, if the server uses an undefined status code and status message when sending a response, what special behavior does the browser perform?


Reply to discussion (solution)

You can try it. it is not difficult to write a statement.

Browsers generally have fault tolerance. I have never tried to do this anyway.

You can give it a try ....

You can try it. it is not difficult to write a statement.

Browsers generally have fault tolerance. I have never tried to do this anyway.

You can give it a try ....

I tried it and didn't find any problems. Except for the different colors of the files returned when viewed in the Chrome review element's Network tag.
But now it's okay. doesn't it mean it's always okay? I want to know if there will be problems in the future.

Easy to write, difficult to write, this is the principle of writing code, the output must be fault tolerant, but the output must meet the specifications

Easy to read and write, this is the principle of writing code, the output must be fault tolerant, but the output must meet the specifications of the server response file header what are the standards? I want to send some text to the browser, but the text cannot exist in the body of the response file and can only be placed in the header. But I don't know if AJAX can get all the headers.

Rfc2616 http 1.1 standard

Check the rfc2616 http 1.1 standard. Is there any Response Header Fields name that will never be used by the standard? I used a name with more than 20 characters, but I still feel uneasy. I checked it just now. AJAX has this method: getResponseHeader (header), which is quite convenient to extract the Header.

Why not use cookies? The cookie is written in the header, not in the body.

Why not use cookies? The cookie is written in the header, not in the body.
4.7.3 The getResponseHeader () method

Client. getResponseHeader (header)
Returns the header field value from the response of which the field name matches header, unless the field name is Set-Cookie or Set-Cookie2.
Http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader ()-method
It is a bit troublesome to use js to read cookies after the server passes them to the browser. In addition, I may make a lot of AJAX requests for asynchronous execution. I don't know if the cookie will be messy.

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.