Open In App

HTTP headers | Want-Digest

Last Updated : 07 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

Before discussing about HTTP Want-Digest Header, let us first understand what is Digest (or message digest) ? HTTP header Digest is an encrypted fixed-size representation of a message generated using a hash function. A hash function can be any function that maps the data of arbitrary size to a fixed size. Message digests are easy to encrypt but very hard to decrypt. It can be said that the process is irreversible. Therefore, message digests protect the integrity of the message and can easily detect any modifications in the message. Various types of hashing algorithms are used for the encryption of these messages.

HTTP Want-Digest header: The HTTP Want-Digest Header is a general HTTP header that requests the server to provide a digest of the requested source using the HTTP Digest response header. The requester sends one or more digest algorithms that can be used to create the digest within the header. If the server does not support these algorithms either the digest is calculated using some different algorithms or a 400 Bad Request is received with a list of supported algorithms in another HTTP Want-Digest Header.

Syntax:

  • For single algorithm:
    Want-Digest: <algorithm>
  • For more than one algorithm plus quality value syntax:
    Want-Digest: <algorithm><q-value>, <algorithm><q-value>

Note: This header can contain multiple digest algorithm.

Directives: The HTTP Want-Digest header accepts two directives mentioned above and described below:

  • <algorithm>: This directive holds the algorithm that supports digest algorithms include SHA-256, MD5 and SHA-512.
  • <q-value>: This directive holds the quality factor associated with the algorithms to indicate the preference of the algorithms. It ranges from 0 to 1, where 1 denotes the highest priority.

Example:

  • This example holding the single digest algorithm without the quality value of that algorithm.
    Want-Digest: sha-512
  • This example holding more than one digest algorithm with the quality value of that algorithm.
    Want-Digest: sha-512;q=0.55, sha-256;q=0, md5;q=1

Supported Browsers: The browsers are compatible with the HTTP Want-Digest header are listed below:

  • Google Chrome
  • Firefox
  • Internet Explorer
  • Edge
  • Opera
  • Safari

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads