Skip to content

Instantly share code, notes, and snippets.

@hoangchungk53qx1
Created January 6, 2024 16:03
Show Gist options
  • Save hoangchungk53qx1/899b605758bcccaf10119cbb54395395 to your computer and use it in GitHub Desktop.
Save hoangchungk53qx1/899b605758bcccaf10119cbb54395395 to your computer and use it in GitHub Desktop.
preRequestScript
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