Preference-Applied 请求头
HTTP Preference-Applied
请求头通知客户端,服务器已应用了来自 Prefer
请求头中的哪些偏好设置。
如果客户端在没有该头的情况下可能产生歧义,服务器会指明是否已将偏好设置应用于响应。
头类型 | 响应头 |
---|---|
禁止的请求头名称 | 否 |
CORS-safelisted 响应头 | 否 |
语法
http
Preference-Applied: <preference>
示例
服务器应用时区偏好设置
以下请求表明客户端偏好以特定时区表示事件
http
GET /events HTTP/1.1
Host: example.com
Prefer: timezone=America/Los_Angeles
服务器支持该偏好,并以 Preference-Applied
请求头返回内容
http
HTTP/1.1 200 OK
Content-Type: application/json
Preference-Applied: timezone=America/Los_Angeles
[
{"t":"2023-10-18T05:37:59.611-07:00"},
{"t":"2023-10-18T07:37:59.611-07:00"},
{"t":"2023-10-18T09:37:59.611-07:00"}
]
规范
规范 |
---|
未知规范 # 第 3 节 |
另见
Prefer
- Prefer 请求头 在 docs.oasis-open.org 上
- Prefer 请求头 在 docs.postgrest.org 上