Preference-Applied header
The Preference-Applied response header serves as a notification from the server to the client, confirming which specific directives from the initial Prefer request header were successfully honored.
Note: A server typically includes this header in its response only when the application of a preference would otherwise be unclear or ambiguous to the client.
This header ensures transparency in communication, allowing the client to know exactly how its requested preferences influenced the server’s processing of the resource.
- Header type: Response header
- Forbidden header name: No
- CORS-safelisted response header: No
Syntax
Preference-Applied: <preference>
Examples
Applying Timezone Preferences
Example: The following request shows how a client can request that event data be returned according to a specific geographical time zone using the Prefer header.
GET /events HTTP/1.1
Host: example.com
Prefer: timezone=America/Los_Angeles
If the server supports this localization, it will process the request and include a Preference-Applied header in the response to confirm the setting was used.
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"}
]
How to Modify Header using Requestly
Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Preference-Applied header. This response header indicates which preference from the Prefer request header was honored by the server. It is useful when testing how your API acknowledges client preferences during development or debugging. Steps to Modify the Preference-Applied Header:
- Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
- Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
- Add a new header modification:
- Under “Action”, select “Add” or “Override”.
- Choose to modify Response Headers.
- In the “Header Name” field, enter Preference-Applied.
- In the “Header Value” field, enter the applied preference (for example, return=minimal).
- Set the URL condition: Specify the URL or pattern where this header should apply (for example, https://your-api.com/\*).
- Save the rule.
Once configured, Requestly will inject the Preference-Applied header into all matching responses. This allows you to simulate how a server confirms that a specific client preference was honored.
You might need to modify the Preference-Applied header to test API behavior, validate client-server preference handling, or debug conditional response logic without modifying your backend code. This helps ensure your API communicates applied preferences clearly and correctly.
Set headers visually: intercept and modify HTTP headers without touching your code using Requestly.
Download Free →