HttpResponseHeader Enum


可在服务器响应中指定的 HTTP 标头。The HTTP headers that can be specified in a server response.

public enum class HttpResponseHeader
public enum HttpResponseHeader
type HttpResponseHeader = 
Public Enum HttpResponseHeader


AcceptRanges 20

Accept-Ranges 标头,指定服务器接受的范围。The Accept-Ranges header, which specifies the range that is accepted by the server.

Age 21

Age 标头,指定自起始服务器生成响应以来的时间长度(以秒为单位)。The Age header, which specifies the time, in seconds, since the response was generated by the originating server.

Allow 10

Allow 标头,指定支持的 HTTP 方法集。The Allow header, which specifies the set of HTTP methods that are supported.

CacheControl 0

Cache-Control 标头,指定请求/响应链上所有缓存机制必须服从的缓存指令。The Cache-Control header, which specifies caching directives that must be obeyed by all caching mechanisms along the request/response chain.

Connection 1

Connection 标头,指定特定连接所需的选项。The Connection header, which specifies options that are desired for a particular connection.

ContentEncoding 13

Content-Encoding 标头,指定应用到随附的正文数据的编码。The Content-Encoding header, which specifies the encodings that have been applied to the accompanying body data.

ContentLanguage 14

Content-Langauge 标头,指定随附的正文数据的自然语言或语言。The Content-Language header, which specifies the natural language or languages of the accompanying body data.

ContentLength 11

Content-Length 标头,指定随附的正文数据的长度(以字节为单位)。The Content-Length header, which specifies the length, in bytes, of the accompanying body data.

ContentLocation 15

Content-Location 标头,指定可以从中获取伴随正文的 URI。The Content-Location header, which specifies a URI from which the accompanying body can be obtained.

ContentMd5 16

Content-MD5 标头,指定随附的正文数据的 MD5 摘要,以便提供端到端消息完整性检查。The Content-MD5 header, which specifies the MD5 digest of the accompanying body data, for the purpose of providing an end-to-end message integrity check. 由于 MD5 出现冲突问题,Microsoft 建议使用基于 SHA256 或更高版本的安全模型。Due to collision problems with MD5, Microsoft recommends a security model based on SHA256 or better.

ContentRange 17

Range 标头,指定客户端请求返回的响应的单个或多个子范围来代替整个响应。The Range header, which specifies the subrange or subranges of the response that the client requests be returned in lieu of the entire response.

ContentType 12

Content-Type 标头,指定随附的正文数据的 MIME 类型。The Content-Type header, which specifies the MIME type of the accompanying body data.

Date 2

Date 标头,指定响应产生的日期和时间。The Date header, which specifies the date and time at which the response originated.

ETag 22

Etag 标头,指定请求的变量的当前值。The Etag header, which specifies the current value for the requested variant.

Expires 18

Expires 标头,指定日期和时间,在该日期和时间之后随附的正文数据将被视为已过期。The Expires header, which specifies the date and time after which the accompanying body data should be considered stale.

KeepAlive 3

Keep-Alive 标头,指定用于维护持久连接的参数。The Keep-Alive header, which specifies a parameter to be used to maintain a persistent connection.

LastModified 19

Last-Modified 标头,指定上次修改随附的正文数据的日期和时间。The Last-Modified header, which specifies the date and time at which the accompanying body data was last modified.

Location 23

Location 标头,指定为获取请求的资源而将客户端重定向到的 URI。The Location header, which specifies a URI to which the client is redirected to obtain the requested resource.

Pragma 4

Pragma 标头,指定特定于实现的指令,这些指令可应用到请求/响应链上的任意代理。The Pragma header, which specifies implementation-specific directives that might apply to any agent along the request/response chain.

ProxyAuthenticate 24

Proxy-Authenticate 标头,指定客户端必须对代理验证其自身。The Proxy-Authenticate header, which specifies that the client must authenticate itself to a proxy.

RetryAfter 25

Retry-After 标头,指定某个时间(以秒为单位)或日期和时间,在此时间之后客户端可以重试其请求。The Retry-After header, which specifies a time (in seconds), or a date and time, after which the client can retry its request.

Server 26

Server 标头,指定关于起始服务器代理的信息。The Server header, which specifies information about the originating server agent.

SetCookie 27

Set-Cookie 标头,指定提供给客户端的 Cookie 数据。The Set-Cookie header, which specifies cookie data that is presented to the client.

Trailer 5

Trailer 标头,指定指示的标头字段在消息(使用分块传输编码方法进行编码)的尾部显示。The Trailer header, which specifies that the indicated header fields are present in the trailer of a message that is encoded with chunked transfer-coding.

TransferEncoding 6

Transfer-Encoding 标头,指定对消息正文应用哪种类型的转换(如果有)。The Transfer-Encoding header, which specifies what (if any) type of transformation has been applied to the message body.

Upgrade 7

Upgrade 标头,指定客户端支持的其他通信协议。The Upgrade header, which specifies additional communications protocols that the client supports.

Vary 28

Vary 标头,指定用于确定缓存的响应是否为新响应的请求标头。The Vary header, which specifies the request headers that are used to determine whether a cached response is fresh.

Via 8

Via 标头,指定网关和代理要使用的中间协议。The Via header, which specifies intermediate protocols to be used by gateway and proxy agents.

Warning 9

Warning 标头,指定消息中可能不会反映的有关消息的状态或转换的其他信息。The Warning header, which specifies additional information about that status or transformation of a message that might not be reflected in the message.

WwwAuthenticate 29

WWW-Authenticate 标头,指定客户端必须对服务器验证其自身。The WWW-Authenticate header, which specifies that the client must authenticate itself to the server.


HTTP/1.1 规范中详细介绍了各种标头的相应内容。The appropriate contents of various headers are described in detail in the HTTP/1.1 specification.

Applies to

See also