HTTP Header大全请求头响应头Content-TypeAuthorization
HTTP Header 大全
按名称、类型或用途查找请求头和响应头,复制名称或示例即可使用。
| 名称 | 类型 | 作用 | 示例 | 操作 |
|---|---|---|---|---|
| Accept | 请求 | 告诉服务器客户端能处理哪些响应格式。 | Accept: application/json | |
| Accept-Encoding | 请求 | 告诉服务器客户端支持的压缩方式。 | Accept-Encoding: gzip, br | |
| Accept-Language | 请求 | 告诉服务器客户端偏好的语言。 | Accept-Language: zh-CN,zh;q=0.9 | |
| Authorization | 请求 | 携带访问令牌或其他认证信息。 | Authorization: Bearer <token> | |
| Cache-Control | 通用 | 控制请求或响应的缓存行为。 | Cache-Control: no-cache | |
| Connection | 通用 | 控制当前连接的选项。HTTP/2 中不应使用。 | Connection: keep-alive | |
| Content-Length | 通用 | 标明消息体的字节长度。 | Content-Length: 348 | |
| Content-Type | 通用 | 标明消息体的数据格式。 | Content-Type: application/json | |
| Cookie | 请求 | 把浏览器保存的 Cookie 发送给服务器。 | Cookie: session_id=abc123 | |
| Host | 请求 | 指定请求的主机名和端口。 | Host: example.com | |
| If-None-Match | 请求 | 配合 ETag 判断缓存内容是否发生变化。 | If-None-Match: "abc123" | |
| Origin | 请求 | 标明跨域请求发起的源。 | Origin: https://example.com | |
| Referer | 请求 | 标明当前请求从哪个页面跳转而来。 | Referer: https://example.com/list | |
| User-Agent | 请求 | 描述发起请求的客户端、系统和浏览器。 | User-Agent: Mozilla/5.0 ... | |
| Access-Control-Allow-Origin | 响应 | 指定允许发起跨域请求的来源。 | Access-Control-Allow-Origin: https://example.com | |
| Cache-Control | 响应 | 告诉客户端和缓存服务器如何保存响应。 | Cache-Control: public, max-age=3600 | |
| Content-Disposition | 响应 | 指定内容以内联方式展示还是作为文件下载。 | Content-Disposition: attachment; filename=report.pdf | |
| Content-Encoding | 响应 | 说明响应体使用了哪种压缩编码。 | Content-Encoding: gzip | |
| ETag | 响应 | 给资源标记一个版本值,用于缓存校验。 | ETag: "abc123" | |
| Location | 响应 | 给出重定向或新资源的目标地址。 | Location: https://example.com/new | |
| Set-Cookie | 响应 | 让浏览器保存或更新 Cookie。 | Set-Cookie: sid=abc; HttpOnly; Secure | |
| Strict-Transport-Security | 响应 | 要求浏览器后续使用 HTTPS 访问。 | Strict-Transport-Security: max-age=31536000 | |
| Vary | 响应 | 告诉缓存系统响应会受哪些请求头影响。 | Vary: Accept-Encoding | |
| X-Content-Type-Options | 响应 | 禁止浏览器猜测响应的 MIME 类型。 | X-Content-Type-Options: nosniff | |
| X-Frame-Options | 响应 | 限制页面是否能被嵌入 iframe。 | X-Frame-Options: SAMEORIGIN |