For faster navigation, this Iframe is preloading the Wikiwand page for HTTP 303.

HTTP 303

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方法后响应时,将用户重定向到所选资源。
  • 如果一个客户端有链接编辑能力,其应当把所有的引用链接重定向到新的URL上。
  • 重定向到新地址时,客户端必须使用GET方法请求新地址。
  • 客户端收到的新的URI,不是原始请求资源的替代引用。
  • 该响应码不应被客户端缓存,惟重定向后的页面不受此限。
  • 除非请求方法是 HEAD, 否则响应实体应该包含一个小型的超文本,标注一个超链接到新的URL。

示例

[编辑]

客户端请求:

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

外部連結

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
HTTP 303
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?