php发出http少了host,PHP教程:HTTP1.0协议下HTTP_HOST为空的根本原因

14.23 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,

Fielding, et al. Standards Track [Page 128]

RFC 2616 HTTP/1.1 June 1999

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

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.

以下省略…..

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值