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 上