400 Bad Request
2015-11-17 13:28
531 查看
All Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message which lacks a Host header field.
![](https://img-blog.csdn.net/20151117132010732)
The Host request-header field specifies the Internet host and port number of the resource being requested, as obtained from the original URI given by the user or referring resource (generally an HTTP URL,
as described in section 3.2.2). The Host field value MUST represent the naming authority of the origin server or gateway given by the original URL. This allows the origin server or gateway to differentiate between internally-ambiguous URLs, such as the root “/” URL of a server for multiple host names on a single IP address.
A “host” without any trailing port information implies the default port for the service requested (e.g., “80” for an HTTP URL). For example, a request on the origin server for http://www.w3.org/pub/WWW/ would properly include:
A client MUST include a Host header field in all HTTP/1.1 request messages . If the requested URI does not include an Internet host name for the service being requested, then the Host header field MUST be given with an empty value. An HTTP/1.1 proxy MUST ensure that any request message it forwards does contain an appropriate Host header field that identifies the service being requested by the proxy. All Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message which lacks a Host header field.
See sections 5.2 and 19.6.1.1 for other requirements relating to Host.
参考
The Host request-header field specifies the Internet host and port number of the resource being requested, as obtained from the original URI given by the user or referring resource (generally an HTTP URL,
as described in section 3.2.2). The Host field value MUST represent the naming authority of the origin server or gateway given by the original URL. This allows the origin server or gateway to differentiate between internally-ambiguous URLs, such as the root “/” URL of a server for multiple host names on a single IP address.
Host = "Host" ":" host [ ":" port ] ; Section 3.2.2
A “host” without any trailing port information implies the default port for the service requested (e.g., “80” for an HTTP URL). For example, a request on the origin server for http://www.w3.org/pub/WWW/ would properly include:
GET /pub/WWW/ HTTP/1.1 Host: www.w3.org
A client MUST include a Host header field in all HTTP/1.1 request messages . If the requested URI does not include an Internet host name for the service being requested, then the Host header field MUST be given with an empty value. An HTTP/1.1 proxy MUST ensure that any request message it forwards does contain an appropriate Host header field that identifies the service being requested by the proxy. All Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message which lacks a Host header field.
See sections 5.2 and 19.6.1.1 for other requirements relating to Host.
参考
相关文章推荐
- 用SpriteBuilder简化"耕牛遍地走"的动画效果(三)
- 用SpriteBuilder简化"耕牛遍地走"的动画效果(三)
- 用SpriteBuilder简化"耕牛遍地走"的动画效果(三)
- 用SpriteBuilder简化"耕牛遍地走"的动画效果(二)
- 用SpriteBuilder简化"耕牛遍地走"的动画效果(二)
- 用SpriteBuilder简化"耕牛遍地走"的动画效果(二)
- 用SpriteBuilder简化"耕牛遍地走"的动画效果(一)
- 用SpriteBuilder简化"耕牛遍地走"的动画效果(一)
- 用SpriteBuilder简化"耕牛遍地走"的动画效果(一)
- SpannableStringBuilder.setSpan()的细节
- iOS 9 学习系列:UI Testing
- GUID 全局唯一标识符
- UIControl中的相关属性和方法
- ol元素及相关属性:type, start, value, 和reversed
- [Leetcode]Longest Increasing Subsequence
- request.getParameter()中文乱码
- 循环结构中break、continue、goto、return和exit的区别
- Handler Looper MessageQueue之MessageQueue
- Handler Looper MessageQueue之Handler
- Handler Looper MessageQueue之Looper