Skip to content

Instantly share code, notes, and snippets.

@hoto
Created February 22, 2021 20:32
Show Gist options
  • Save hoto/e9cc4be58921ecfa8add6450362ac8b2 to your computer and use it in GitHub Desktop.
Save hoto/e9cc4be58921ecfa8add6450362ac8b2 to your computer and use it in GitHub Desktop.
const getAccessTokenRequest = {
url: 'http://localhost:5050',
method: 'GET',
};
pm.sendRequest(getAccessTokenRequest, (err, res) => {
console.log(err ? err : res.json());
if (err === null) {
console.log("Saving the access token");
var responseJson = res.json();
pm.environment.set("currentAccessToken", responseJson.access_token);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment