HTTP 302重定向 - 是否需要消息体? [英] HTTP 302 Redirect - is a message-body needed?

查看:1515
本文介绍了HTTP 302重定向 - 是否需要消息体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RFC 2616 未指定邮件正文是否为需要与否,我认为是可选的。省略邮件正文是否有任何实际危险?

RFC 2616 doesn't specify whether a message-body is needed or not, which I interpret as being optional. Is there any practical danger in omitting a message body?

例如,某些浏览器中是否存在由302中的空白邮件正文触发的错误(或功能) ?

For example, are there bugs (or features) in certain browsers that are triggered by a blank message body in a 302?

推荐答案

不需要。然而,RFC2616也没有禁止它。请注意,确实禁止某些状态的邮件正文,例如 204 304 。如果302的情况也是如此,那么肯定会明确提到它。

It's not needed. The RFC2616 however doesn't forbid it as well. Note that it does forbid the message body for certain statuses, such as 204 and 304. If the same were true for 302, then it should surely have been explicitly mentioned.

据我所知,所有现代浏览器都会忽略302的消息体到GET或POST,将直接转到位置标题中指定的URL。

As far as I know, all modern browsers ignore the message body of a 302 in response to a GET or POST and will directly go to the URL as specified in Location header.

这篇关于HTTP 302重定向 - 是否需要消息体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆