Skip to content

Instantly share code, notes, and snippets.

@dariayermolova
Last active May 13, 2021 10:59
Show Gist options
  • Save dariayermolova/4983ad293937dd0a12e150f7bf4e8988 to your computer and use it in GitHub Desktop.
Save dariayermolova/4983ad293937dd0a12e150f7bf4e8988 to your computer and use it in GitHub Desktop.
var random_id = parseInt(Math.random() * 10000);
pm.environment.set("random_id", random_id);
var domain = pm.environment.get("domain");
pm.sendRequest({
url: "https://api"+domain+"./signup",
method: 'POST',
header: {
'Content-Type': 'application/json',
},
body: {
mode: 'raw',
raw: JSON.stringify({"email":"test",
"password":"test"})
}
}, function (err, response) {
pm.environment.set("token", response.json().data.token);
pm.environment.set("id", response.json().data.user.data.id);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment