HTTP Client crypto API reference
The crypto
object provides access to HTTP Client Crypto API, which lets you use cryptographic hash functions and HMAC to generate HTTP signatures. You can then use these signatures as variables in pre-request scripts to sign your HTTP requests.
The crypto
accepts a method that can be either one of the hash functions (sha1
, sha256
, sha512
, md5
), or hmac.
Hash methods
Method | Parameters | Description |
---|---|---|
|
| Updates a string to be transformed to a hash. |
|
| Updates a hexadecimal string to be transformed to a hash. |
|
| Updates a Base64 string to be transformed to a hash. |
| — | Generates a hash and convert it to the hexadecimal format. |
|
| Generates a hash and convert it to the Base64 format. |
Example:
HMAC methods
The crypto.hmac
object enables you to use HMAC to sign HTTP requests. It has access to all hash methods to generate hashes but also has methods to get the secret part of the token.
Method | Parameters | Description |
---|---|---|
|
| Puts the secret key to be used in HMAC. |
|
| Puts the secret key in the hexadecimal format. |
|
| Puts the secret key in the Base64 format. |
Example: