开发者

Sending more than one HTTP status code in a script

More of a sanity check than开发者_如何学Python anything else.

Do browsers always use the last HTTP status code that I send from my script?

For instance if I sent a 200 and then send a 404, will all browsers correctly handle the page as 404?


The browser will only ever receive one. The HTTP protocol does not permit multiple status codes.

If your script is trying to send several, then it's up to the server-side framework to handle that so that only one gets sent. Exactly what happens is going to depend on the framework in question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜