Does the HTTP status code affect the content of the browser display?

Source: Internet
Author: User
For example, when a server sends a response with an undefined status code and status message, what is the specific behavior of the browser?


Reply to discussion (solution)

You can try it, it's not hard to write a statement.

Browsers generally can be fault-tolerant, anyway, I never tried to do that.

You can write a try ....

You can try it, it's not hard to write a statement.

Browsers generally can be fault-tolerant, anyway, I never tried to do that.

You can write a try ....

I tried, and I didn't find anything wrong. The files returned are not the same color except when viewed in the Network tab of Chrome's censorship elements.
But now, no problem, doesn't mean it's always going to be a problem? What I want to know is whether there will be any problems in the future.

Easy to enter, this is the principle of writing code, output to fault tolerance, but the output must conform to specifications

Easy into the hard out, this is the principle of writing code, output to fault tolerance, but the output must conform to the specifications of the extension server response file of the header what is the standard? I want to send some text to the browser, but the text does not exist in the body of the response file, but only in the header. But I don't know if Ajax can get all the head.

Check rfc2616 HTTP 1.1 standard

Check rfc2616 HTTP 1.1 standard is there any kind of response Header fields whose name is definitely not used by the standard? I have just used a name of more than 20 characters, but I still feel not at ease. Just checked, Ajax has this method: getResponseHeader (header), extracting the header is quite convenient.

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

Why not use cookies? The cookie is written in the header, not in the text
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-cook IE or set-cookie2.
http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader ()-method
After the server is passed to the browser and use JS to read the cookie, it feels a bit troublesome. And I do this thing there may be a lot of Ajax requests asynchronous execution, do not know whether the use of cookies will be messed up.

  • 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.