代码、数据与二维码工具

HTTP 标头参考

筛选常见 HTTP 标头,查看方向和用途,并复制标头名称用于文档或实现。

优先本地处理无需注册隐私说明 ↗

按名称、类别或用途搜索。所有操作都在浏览器本地完成。

Acceptcontent

Describes the media types the client can process.

请求和响应
Accept-Encodingcontent

Lists content codings the client can decode.

请求
Authorizationsecurity

Carries credentials for the requested resource.

请求
Cache-Controlcaching

Controls caching rules for browsers and intermediaries.

请求和响应
Content-Lengthcontent

Gives the size of the message body in bytes.

请求和响应
Content-Typecontent

Describes the media type and optional character set of the body.

请求和响应
Cookiecookies

Sends stored cookies to the server for the current domain.

请求
ETagconditional

Identifies a specific representation for cache validation.

响应
Hostgeneral

Identifies the host and optional port targeted by the request.

请求
If-None-Matchconditional

Makes a request conditional on an ETag not matching.

请求
If-Modified-Sinceconditional

Requests a response only when a representation changed after a date.

请求
Locationgeneral

Provides a URL for redirects or a newly created resource.

响应
Origincors

Identifies the origin that initiated a request.

请求
Referergeneral

Identifies the address of the page that made the request.

请求
Set-Cookiecookies

Asks the browser to store a cookie.

响应
Strict-Transport-Securitysecurity

Tells browsers to use HTTPS for a host for a period of time.

响应
User-Agentgeneral

Identifies the client software making the request.

请求
Varycaching

Lists request headers that affect representation selection.

响应
WWW-Authenticatesecurity

Defines an authentication challenge for a protected resource.

响应
X-Content-Type-Optionssecurity

Prevents MIME sniffing when set to nosniff.

响应

使用步骤

如何使用

  1. 按标头名称或用途搜索,或选择方向和类别。
  2. 查看标头说明,以及它适用于请求、响应还是两者。
  3. 复制标头名称用于文档或实现。

聚焦的 HTTP 标头参考

列表涵盖常用标准、CORS、安全、缓存、内容和条件请求标头。它是实用查询工具,不能替代规范。

方向很重要

有些标头由客户端发送,有些由服务器发送,还有些适用于两个方向。方向筛选可帮助你避免把仅响应标头复制到请求中。

本地运行

参考数据随页面打包。搜索、筛选和复制不会将查询或所选标头发送到服务器。

常见问题

你可能还想知道

这里包含每个已注册的 HTTP 标头吗?

不包含。它侧重日常 Web 开发常用标头,并包含少量已确立的安全和 CORS 标头。

每个标头都能用于两个方向吗?

不能。请查看方向标签。请求标头由客户端发送,响应标头由服务器发送,通用标头可用于任一消息。

搜索会联系服务器吗?

不会。数据和所有交互都在浏览器本地运行。