HttpResponseMessage.TrailingHeaders 属性

定义

获取 HTTP 响应中包含的尾随标头的集合。Gets the collection of trailing headers included in an HTTP response.

public:
 property System::Net::Http::Headers::HttpResponseHeaders ^ TrailingHeaders { System::Net::Http::Headers::HttpResponseHeaders ^ get(); };
public System.Net.Http.Headers.HttpResponseHeaders TrailingHeaders { get; }
member this.TrailingHeaders : System.Net.Http.Headers.HttpResponseHeaders
Public ReadOnly Property TrailingHeaders As HttpResponseHeaders

属性值

HTTP 响应中尾随标头的集合。The collection of trailing headers in the HTTP response.

例外

PROTOCOL_ERROR:HTTP/2 响应包含尾随标头框架的伪标头。PROTOCOL_ERROR: The HTTP/2 response contains pseudo-headers in the Trailing Headers Frame.

注解

将忽略禁止的标头。Forbidden headers will be ignored.

由于尾随标头是作为附加在响应消息末尾的 HTTP 标头发送的,因此 TrailingHeaders 属性返回一个空的 HttpResponseHeaders 实例(如果已访问),并且未完全读取响应内容。Since trailing headers are sent as an HTTP header appended at the end of the response message, the TrailingHeaders property returns an empty HttpResponseHeaders instance if it is accessed and the response content has not been read completely.

有关尾随标头的其他信息,请参阅RFC 7230-4.1.2。块尾部分For additional information on trailing headers, see RFC 7230 - 4.1.2. Chunked Trailer Part.

适用于