权威 http header - 在 chrome 开发工具中
authority http header - in chrome dev tools
chrome 开发工具 - 显示一些带有前导 :
的 http header(不确定为什么它对某些而不对其他的起作用)。
其中一个是 http header authority
,显示为:
authority:api.somedomain.com
然而,这列在维基百科的 http headers 列表中。这是新的 HTTP2 header 还是可以在 header 中定义任何新的请求字段 - 或者这些是否已修复?
这些是 Pseudo-Header Fields
在新 HTTP/2 中定义的。
HTTP/1.x使用消息start-line
来表示目标URI、请求方法、响应码等。所有的HTTP消息要么是客户端对服务器的请求,要么是客户端的响应服务器到客户端。这两种类型通过它们的 start-line
来区分,即 request-line
表示请求,或 status-line
表示响应。
request-line = method SP request-target SP HTTP-version CRLF
status-line = HTTP-version SP status-code SP reason-phrase CRLF
您可以在 RFC7230 section 3.1
中阅读更多内容
但是 HTTP/2 为此目的使用以“:”字符 (ASCII 0x3a) 开头的特殊 pseudo-header 字段。这些 pseudo-header 是严格定义的。有请求 pseudo-header 字段和响应 pseudo-header 字段。请求 pseudo-header 字段为 :method
、:scheme
、:authority
、:path
.
The ":authority" pseudo-header field includes the authority portion of the target URI.
authority = [ userinfo "@" ] host [ ":" port ]
在 RFC7540 阅读更多内容。
在HTTP/1.x中相当于host
header字段。在 RFC7540 中,提到了一些向后兼容 HTTP/1.x
的措施
To ensure that the HTTP/1.1 request line can be reproduced accurately, this pseudo-header field MUST be omitted when translating from an HTTP/1.1 request that has a request target in origin or asterisk form. Clients that generate HTTP/2 requests directly SHOULD use the ":authority" pseudo-header field instead of the Host header field. An intermediary that converts an HTTP/2 request to HTTP/1.1 MUST create a Host header field if one is not present in a request by copying the value of the ":authority" pseudo-header field.
chrome 开发工具 - 显示一些带有前导 :
的 http header(不确定为什么它对某些而不对其他的起作用)。
其中一个是 http header authority
,显示为:
authority:api.somedomain.com
然而,这列在维基百科的 http headers 列表中。这是新的 HTTP2 header 还是可以在 header 中定义任何新的请求字段 - 或者这些是否已修复?
这些是 Pseudo-Header Fields
在新 HTTP/2 中定义的。
HTTP/1.x使用消息start-line
来表示目标URI、请求方法、响应码等。所有的HTTP消息要么是客户端对服务器的请求,要么是客户端的响应服务器到客户端。这两种类型通过它们的 start-line
来区分,即 request-line
表示请求,或 status-line
表示响应。
request-line = method SP request-target SP HTTP-version CRLF
status-line = HTTP-version SP status-code SP reason-phrase CRLF
您可以在 RFC7230 section 3.1
中阅读更多内容但是 HTTP/2 为此目的使用以“:”字符 (ASCII 0x3a) 开头的特殊 pseudo-header 字段。这些 pseudo-header 是严格定义的。有请求 pseudo-header 字段和响应 pseudo-header 字段。请求 pseudo-header 字段为 :method
、:scheme
、:authority
、:path
.
The ":authority" pseudo-header field includes the authority portion of the target URI.
authority = [ userinfo "@" ] host [ ":" port ]
在 RFC7540 阅读更多内容。
在HTTP/1.x中相当于host
header字段。在 RFC7540 中,提到了一些向后兼容 HTTP/1.x
To ensure that the HTTP/1.1 request line can be reproduced accurately, this pseudo-header field MUST be omitted when translating from an HTTP/1.1 request that has a request target in origin or asterisk form. Clients that generate HTTP/2 requests directly SHOULD use the ":authority" pseudo-header field instead of the Host header field. An intermediary that converts an HTTP/2 request to HTTP/1.1 MUST create a Host header field if one is not present in a request by copying the value of the ":authority" pseudo-header field.