跳到内容
🛠️ToolsShed

HTTP 标头参考

可搜索的 HTTP 请求和响应标头参考表。

头部类型分类描述
AcceptRequestContent NegotiationMedia types acceptable for the response (e.g. text/html, application/json).
Accept-CharsetRequestContent NegotiationCharacter sets acceptable for the response.
Accept-EncodingRequestContent NegotiationEncoding algorithms the client supports (e.g. gzip, deflate, br).
Accept-LanguageRequestContent NegotiationNatural languages preferred for the response (e.g. en-US, fr).
AuthorizationRequestAuthenticationCredentials for authenticating the client with the server (e.g. Bearer token).
CookieRequestStateHTTP cookies previously set by the server, sent back with each request.
ExpectRequestRequest ControlIndicates that particular server behaviors are required by the client (e.g. 100-continue).
HostRequestRequest TargetDomain name and port number of the server being addressed. Required in HTTP/1.1.
If-MatchRequestConditionalMakes the request conditional based on matching ETag values.
If-Modified-SinceRequestConditionalMakes the request conditional based on modification date.
If-None-MatchRequestConditionalMakes the request conditional based on non-matching ETag values.
If-Unmodified-SinceRequestConditionalMakes the request conditional on the resource not being modified since the given date.
OriginRequestCORSIndicates the origin from which the cross-site request is initiated.
Proxy-AuthorizationRequestAuthenticationCredentials for authenticating with a proxy server.
RangeRequestPartial RequestsRequests only part of a resource (e.g. bytes=0-1023 for the first 1 KB).
RefererRequestRequest ContextURL of the page from which the request originated.
TERequestTransfer EncodingSpecifies transfer encodings the client is willing to accept.
User-AgentRequestRequest ContextContains information about the client software making the request.
X-Forwarded-ForRequestProxiesIdentifies the originating IP address when the request passes through proxies.
X-Requested-WithRequestCustomCommonly used to identify Ajax requests (value: XMLHttpRequest).
Accept-RangesResponsePartial RequestsIndicates if the server supports range requests (bytes or none).
AgeResponseCachingTime in seconds the object has been stored in a proxy cache.
AllowResponseRequest MethodsHTTP methods allowed for the requested resource (used in 405 responses).
Content-DispositionResponseResponse BodyIndicates whether content should be displayed inline or as a file download.
Content-EncodingResponseResponse BodyEncoding applied to the response body (e.g. gzip, br).
Content-LanguageResponseContent NegotiationNatural language(s) of the response body.
Content-LengthResponseResponse BodySize of the response body in bytes.
Content-RangeResponsePartial RequestsIndicates the range of bytes sent in a partial content response (206).
ETagResponseCachingUnique identifier for the specific version of a resource; used for cache validation.
ExpiresResponseCachingDate/time after which the response is considered stale.
Last-ModifiedResponseCachingDate and time the resource was last modified on the server.
LocationResponseRedirectsURL to redirect the client to in 3xx or 201 responses.
Proxy-AuthenticateResponseAuthenticationDefines the authentication method to use for a proxy (407 response).
Retry-AfterResponseRequest ControlHow long to wait before making a new request after a 429 or 503 response.
ServerResponseServer InfoSoftware information about the origin server.
Set-CookieResponseStateSends a cookie from the server to the client for storage.
Strict-Transport-SecurityResponseSecurityHSTS: forces browsers to use HTTPS for subsequent requests.
VaryResponseCachingTells caches which request headers to use as cache keys.
WWW-AuthenticateResponseAuthenticationDefines the authentication method for accessing the resource (401 response).
X-Content-Type-OptionsResponseSecurityPrevents MIME sniffing. Use value: nosniff.
X-Frame-OptionsResponseSecurityControls whether the page can be embedded in an iframe (DENY, SAMEORIGIN).
X-XSS-ProtectionResponseSecurityEnables XSS filtering in older browsers (legacy, mostly deprecated).
Cache-ControlBothCachingDirectives for caching in requests and responses (e.g. no-cache, max-age=3600).
ConnectionBothConnection ManagementControls whether the network connection stays open (keep-alive or close).
Content-TypeBothResponse BodyMedia type of the request or response body (e.g. application/json).
DateBothTimestampsDate and time the message was sent.
PragmaBothCachingLegacy cache control directive (no-cache). Superseded by Cache-Control.
TrailerBothTransfer EncodingIndicates which headers will be present in the trailer of a chunked response.
Transfer-EncodingBothTransfer EncodingEncoding applied to the message body for transfer (e.g. chunked).
ViaBothProxiesAdded by proxies to indicate intermediate protocols and recipients.
WarningBothRequest ControlGeneral warnings about possible problems with the message (deprecated in RFC 9110).
Access-Control-Allow-OriginResponseCORSSpecifies which origins are allowed for CORS requests.
Access-Control-Allow-MethodsResponseCORSHTTP methods allowed for CORS preflight responses.
Access-Control-Allow-HeadersResponseCORSHTTP headers allowed in CORS preflight responses.
Access-Control-Allow-CredentialsResponseCORSIndicates if the response can be shared when credentials are included.
Access-Control-Max-AgeResponseCORSHow long the preflight response can be cached (in seconds).
Cross-Origin-Opener-PolicyResponseSecurityControls the browsing context group for cross-origin documents.
Cross-Origin-Resource-PolicyResponseSecurityPrevents cross-origin reads of the response in certain contexts.
Content-Security-PolicyResponseSecuritySpecifies allowed sources for content types to prevent XSS and injection attacks.
Referrer-PolicyResponseSecurityControls how much referrer information is sent with requests.
Permissions-PolicyResponseSecurityControls browser features and APIs that are allowed to be used (formerly Feature-Policy).

关于此工具

HTTP 头部是随附于每个网络请求和响应的元数据字段,控制着从缓存行为到身份验证和内容协商的一切。HTTP Headers Reference 是一份关于现代网络开发中最常见和最重要的头部的可搜索指南,帮助开发人员快速理解每个头部的作用、接受的值以及何时使用它。

只需搜索头部名称或浏览分类列表,即可找到其目的、语法和典型用例的详细信息。无论是调试 CORS 错误、配置缓存控制、设置安全策略还是理解重定向行为,这份参考资料都能直击要点,为您提供所需的准确信息,无需离开此页面。

此工具对后端开发人员、前端工程师、DevOps 专业人员和任何管理 HTTP 基础设施的人员都至关重要。它完全在浏览器中运行,无需服务器调用,在构建 API、配置网络服务器或排查生产环境中的请求头问题时,提供快速且私密的离线参考。

常见问题

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.