Want-Digest

The HTTP Want-Digest request header is used by a client to ask the server for a digest of the requested resource.

Usage

The HTTP Want-Digest request header informs the server that the client wants to have it calculate a message digest for the requested resource, and have it returned with the HTTP response. Upon return, the server will include the HTTP Digest header, which will contain the digest value as well as the name of the algorithm used to calculate it.

This mechanism can be used by a client to ensure that the resource received matches that which the server sent, helping to eliminate transmission errors.

The two directives are the digest-algorithm and the quality value q. Multiple algorithms can be included on the same line in a comma-delimited format, with the optional q parameter to indicate specific preferences.

If the server does not support the requested hashing algorithm then it will use an alternative and return it in the HTTP Digest header, or instead return HTTP error 400 Bad Request.

Example

In this example, the client requests that the HTTP response include a digest value for the resource using the sha-512 hashing algorithm. If it is not available, then sha-256 is to be used.

Want-Digest: sha-512, sha-256;q=0.5

Takeaway

The HTTP Want-Digest request header is included to ask the server to calculate and send a message digest with the requested resource.

See also

Last updated: June 2, 2022