HTTP 303 See Other ,自 RFC 2616(HTTP 1.1)起,用于在收到HTTP POST请求之后,进行URL重定向的操作。[1]

引入

[编辑]

虽然RFC 1945RFC 2068规范不允许客户端在重定向时改变请求的方法,但是很多现存的浏览器在收到302响应时,直接使用GET方式访问在Location中规定的URI,而无视原先请求的方法。[2]因此状态码303被添加了进来,用以明确服务器期待客户端进行何种反应。[3]

定义

[编辑]

根据RFC 2616定义:

示例

[编辑]

客户端请求:

POST /blog/comment HTTP/1.1
Host: www.example.com
Content-Type:application/x-www-form-urlencoded; charset=UTF-8

服务器回应:

HTTP/1.1 303 See Other
Location: http://www.example.org/view-comment.asp

参见

[编辑]

参考文献

[编辑]
  1. ^ W3C: 10 Status Code Definitions. [2016-01-21]. (原始内容存档于2010-03-16). 
  2. ^ Reference of method redirect_to in Ruby Web Framework "Ruby on Rails". It states: The redirection happens as a "302 Moved" header unless otherwise specified.. [June 30, 2012]. (原始内容存档于2012-07-05). 
  3. ^ Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content, Section 6.4. IETF. [June 12, 2014]. (原始内容存档于2017-05-25). 

外部連結

[编辑]