Created
January 6, 2024 16:03
-
-
Save hoangchungk53qx1/899b605758bcccaf10119cbb54395395 to your computer and use it in GitHub Desktop.
preRequestScript
This file contains hidden or 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
const postRequest = { | |
url: "https://ca6e-2405-4803-fc0e-22e0-54a1-487d-d4c6-ab89.ngrok-free.app/api/auth/login", | |
method: 'POST', | |
header: { | |
'Content-Type': 'application/json', | |
}, | |
body: { | |
mode: 'raw', | |
raw: JSON.stringify({"username" : "user1234", "password" : "User12345"}) | |
} | |
}; | |
pm.sendRequest(postRequest, (error, response) => { | |
const res = response.json(); | |
pm.environment.set("accessTokenDemo", res.access_token); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment