🎉 Requestly joins BrowserStack to build the future of application testing. Read more

HTTP Headers

Want Repr Digest

HTTP Header

The HTTP Want-Repr-Digest request and response headers indicate a preference for the recipient to send a Repr-Digest integrity header in messages associated with the request URI and representation metadata.

 

The headers include hashing algorithm preferences that the recipient can use in subsequent messages.
The preferences only serve as hints, and the recipient may ignore the algorithm choices or the integrity headers entirely.

 

Some implementations may send unsolicited Repr-Digest headers without requiring a Want-Repr-Digest header in a previous message.

 

 

Representation headers are a specific type of HTTP header that provide information about the representation of a resource. They do not block or restrict requests but serve as metadata to facilitate integrity verification and caching strategies.

Syntax

A comma-separated list of one or more hashing algorithms:

http
Want-Repr-Digest: <algorithm>=<preference>
Want-Repr-Digest: <algorithm>=<preference>, <algorithm2>=<preference2>, …, <algorithmN>=<preferenceN>

Directives

Directives

<algorithm>
The specified algorithm is used to generate a digest of the representation.
Only two registered digest algorithms are considered secure: sha-512 and sha-256
Insecure (legacy) registered digest algorithms include: md5, sha (SHA-1), unixsum, unixcksum, adler (ADLER32), and crc32c.
<preference>
This is an integer value ranging from 0 to 9, where 0 indicates “not acceptable” and values from 1 to 9 represent increasing degrees of preference.
Unlike earlier drafts, the preference weighting is not specified using q quality values.

Example

This section provides examples of HTTP headers and discusses browser compatibility considerations.

http
Want-Repr-Digest: sha-512=8, sha-256=6, adler=0, sha=1
Want-Repr-Digest: sha-512=10, sha-256=1, md5=0

This header does not have a predefined browser implementation, so “browser compatibility” does not apply.
Developers can set and retrieve HTTP headers using fetch() to enable application-specific behavior.

How to Modify Header using Requestly

Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Want-Repr-Digest header. This is especially useful for testing how your server responds to different representation digests during development or debugging. Steps to Modify Want-Repr-Digest 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”.
    • In the “Header Name” field, enter Want-Repr-Digest.
    • In the “Header Value” field, enter the digest algorithm(s) you want the server to use (e.g., sha-256).
  4. Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
  5. Save the rule.

Once set up, Requestly will inject the Want-Repr-Digest: sha-256 header into all matching requests, allowing you to test how your server handles and responds with representation digests appropriately.

You might need to modify the Want-Repr-Digest header to verify if your server generates and returns content digests correctly. This helps ensure data integrity and secure content delivery during development and testing.