Skip to content

Instantly share code, notes, and snippets.

@d8vjork
Last active September 24, 2018 14:10
Show Gist options
  • Save d8vjork/9b05c32804be548b22c5af9afd02e97f to your computer and use it in GitHub Desktop.
Save d8vjork/9b05c32804be548b22c5af9afd02e97f to your computer and use it in GitHub Desktop.
Postman pre-request script (get token - JWT)
pm.sendRequest({
url: pm.variables.get("auth_url"),
method: 'POST',
header: {
'Content-Type': 'application/json',
},
body: {
mode: 'raw',
raw: JSON.stringify({
'email': pm.variables.get("auth_email"),
'password': pm.variables.get("auth_pass"),
})
}
}, function (err, response) {
pm.variables.set("token", response.json().token);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment