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.