content-digest
of an HTTP request.
Calculate the For all requests that contain a body, the content digest of the body must be calculated and added as a request header named content-digest
, as described in the IETF draft for HTTP digest fields.
In summary, the digest calculation algorithm as used for the Investment API can be applied as follows:
- Capture the entire request body's byte stream.
- Calculate the SHA-512 hash of the body content.
- Encode the resulting value using Base64 encoding
- Add a request header named
content-digest
with this value:sha-512=:{digest value}:
, where{digest value}
is replaced by the result of the previous step.
From the above description you should now understand how to calculate a digest. Here are some examples you can use to check your understanding.
Was this page helpful?