Skip to content

Instantly share code, notes, and snippets.

@absk1317
Created January 31, 2018 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save absk1317/c67c9387092db983cafc60cae2a831e1 to your computer and use it in GitHub Desktop.
Save absk1317/c67c9387092db983cafc60cae2a831e1 to your computer and use it in GitHub Desktop.
pm.sendRequest({
url: 'http://localhost:3000/api/v1/users/sign_in',
method: 'POST',
header: 'content-type:application/json',
body: {
mode: 'raw',
raw: JSON.stringify({ user: {
email: 'abcd@gmail.com',
password: "abcdef"
}})
}
}, function (err, res, xhr) {
var token = res.headers.get('authorization');
console.log(token);
pm.globals.set("token", token);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment