Last active
May 13, 2021 10:59
-
-
Save dariayermolova/4983ad293937dd0a12e150f7bf4e8988 to your computer and use it in GitHub Desktop.
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
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