Skip to content

Instantly share code, notes, and snippets.

@dariayermolova
Last active April 16, 2019 15:19
Show Gist options
  • Save dariayermolova/4fdb8b9bb827cfb4b96c4a7a5d5a1382 to your computer and use it in GitHub Desktop.
Save dariayermolova/4fdb8b9bb827cfb4b96c4a7a5d5a1382 to your computer and use it in GitHub Desktop.
pm.sendRequest({
url: "<host>/api/sign_in",
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'raw',
raw: JSON.stringify({
"email": pm.environment.get("user_email"),
"password": pm.environment.get("user_password")
})
}
}, function (err, response) {
if (response) {
pm.environment.set("access_token_header", response.headers.get('access-token'));
pm.environment.set("client_header", response.headers.get('client'));
pm.environment.set("expiry_header", response.headers.get('expiry'));
pm.environment.set("uid_header", response.headers.get('uid'));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment