title | slug | page-type | status | browser-compat | ||
---|---|---|---|---|---|---|
Want-Digest |
Web/HTTP/Headers/Want-Digest |
http-header |
|
http.headers.Want-Digest |
{{HTTPSidebar}}{{Deprecated_Header}}{{non-standard_header}}
Note
This header was removed from the specification in draft 8.
Use {{HTTPHeader("Want-Content-Digest")}} instead.
For id-*
digest algorithms, use {{HTTPHeader("Want-Repr-Digest")}}.
The Want-Digest
request or response HTTP header requests the other side to provide a {{Glossary("digest")}} using the {{HTTPHeader("Digest")}} header.
The header contains identifiers for one or more digest algorithms that the sender wishes the server to use to create the digest. The request may use {{Glossary("quality values")}} to indicate its preference/order for particular digest algorithms.
If Want-Digest
does not include any digest algorithms that the server supports, the server may respond with:
- a digest calculated using a different digest algorithm, or
- a
400 Bad Request
error, and include anotherWant-Digest
header with that response, listing the algorithms that it does support.
See also the {{HTTPHeader("Digest")}} header.
Header type | {{Glossary("Request header")}}, {{Glossary("Response header")}} |
---|---|
{{Glossary("Forbidden header name")}} | no |
Want-Digest: <digest-algorithm>
// Multiple algorithms, weighted with the quality value syntax:
Want-Digest: <digest-algorithm><q-value>,<digest-algorithm><q-value>
- <digest-algorithm>
- : Digest algorithms are defined in Digest Headers.
- Permitted digest algorithms values include:
unixsum
,unixcksum
,crc32c
,sha-256
andsha-512
,id-sha-256
,id-sha-512
- Deprecated algorithms values include:
md5
,sha
,adler32
.
- Permitted digest algorithms values include:
- : Digest algorithms are defined in Digest Headers.
- <q-value>
- : The quality value to apply to that option.
Want-Digest: sha-256
Want-Digest: SHA-512;q=0.3, sha-256;q=1, md5;q=0
The sender provides a list of digests which it is prepared to accept, and the server uses one of them:
Request:
GET /item
Want-Digest: sha-256;q=0.3, sha;q=1
Response:
HTTP/1.1 200 Ok
Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
The server does not support any of the requested digest algorithms, so uses a different algorithm:
Request:
GET /item
Want-Digest: sha;q=1
Response:
HTTP/1.1 200 Ok
Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
The server does not support any of the requested digest algorithms.
In this case it responds with a 400 error and includes another Want-Digest
header, listing the algorithms that it does support:
Request:
GET /item
Want-Digest: sha;q=1
Response:
HTTP/1.1 400 Bad Request
Want-Digest: sha-256, sha-512
{{Specifications}}
{{Compat}}
- {{HTTPHeader("Digest")}}