📣 Requestly  –  Local first & light weight alternative to Postman. Try now ->

HTTP Headers

Preference-Applied header

HTTP 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.

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>

Directives

Example

Applying Timezone Preferences

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:

  1. Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
  2. Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
  3. 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).
  4. Set the URL condition: Specify the URL or pattern where this header should apply (for example, https://your-api.com/*).
  5. 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.