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.
- For single 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.
- This example holding the single digest algorithm without the quality value of that algorithm.
- 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
- Internet Explorer
- HTTP headers | Access-Control-Expose-Headers
- HTTP headers | Access-Control-Allow-Headers.
- HTTP headers | Access-Control-Request-Headers
- HTTP headers | Location
- HTTP headers | User-Agent
- HTTP headers | Link
- HTTP headers | Save-Data
- HTTP headers | Content-Type
- HTTP headers | X-Forwarded-Proto
- HTTP headers | X-XSS-Protection
- HTTP headers | X-Frame-Options
- HTTP headers | Last-Modified
- HTTP headers | Date
- HTTP headers | Cookie
- HTTP headers | Strict-Transport-Security
- HTTP headers | Expect
- HTTP headers | Accept-Encoding
- HTTP headers | Proxy-Authenticate
- HTTP headers | Content-Range
- HTTP headers | Content-Encoding
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.