Created
June 25, 2022 19:38
-
-
Save mark05e/ac9b0afa42dd9d40dd961847d8fb6cf4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-app-configuration/rest-api-postman.md | |
// TODO: Replace the following placeholders with your access key | |
var credential = "<Credential>"; // Id | |
var secret = "<Secret>"; // Value | |
var isBodyEmpty = pm.request.body === null || pm.request.body === undefined || pm.request.body.isEmpty(); | |
var headers = signRequest( | |
pm.request.url.getHost(), | |
pm.request.method, | |
pm.request.url.getPathWithQuery(), | |
isBodyEmpty ? undefined : pm.request.body.toString(), | |
credential, | |
secret); | |
// Add headers to the request | |
headers.forEach(header => { | |
pm.request.headers.upsert({key: header.name, value: header.value}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment