大网数据广告活动
Web 标准与前端开发

Want-Repr-Digest header

· 52CE 我爱测

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

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

The header includes hashing algorithm preferences that the recipient can use in subsequent messages. The preferences only serve as a hint, 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.

<table class="properties"> <tbody> <tr> <th scope="row">Header type</th> <td>Request header, Response header, Representation header</td> </tr> <tr> <th scope="row">Forbidden request header</th> <td>No</td> </tr> </tbody> </table>

Syntax

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

Directives

  • <algorithm>
    • : The requested algorithm to create a digest of the representation. Only two registered digest algorithms are considered secure: sha-512 and sha-256. The insecure (legacy) registered digest algorithms are: md5, sha (SHA-1), unixsum, unixcksum, adler (ADLER32) and crc32c.
  • <preference>
    • : An integer from 0 to 9 where 0 means "not acceptable", and the values 1 to 9 convey ascending, relative, weighted preference. In contrast to earlier drafts of the specifications, the weighting is not declared via q quality values.

Examples

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

Specifications

Browser compatibility

This header has no specification-defined browser integration ("browser compatibility" does not apply). Developers can set and get HTTP headers using fetch() in order to provide application-specific implementation behavior.

See also

  • Content-Digest, Repr-Digest, Want-Content-Digest digest headers
  • Digital Signatures for APIs SDK guide uses Content-Digests for digital signatures in HTTP calls (developer.ebay.com)

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。