Last active
September 24, 2018 14:10
-
-
Save d8vjork/9b05c32804be548b22c5af9afd02e97f to your computer and use it in GitHub Desktop.
Postman pre-request script (get token - JWT)
This file contains 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
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