Skip to content

Instantly share code, notes, and snippets.

View enhoang's full-sized avatar
💫
Weeeeeeee~~

En Hoang enhoang

💫
Weeeeeeee~~
  • Ho Chi Minh
  • 16:00 (UTC +07:00)
View GitHub Profile
@enhoang
enhoang / 01-Postman-Scripts.md
Created June 5, 2023 04:26 — forked from alexandramartinez/01-Postman-Scripts.md
Postman scripts cheatsheet

Postman Scripts Cheatsheet

Here you can find some of the most used scripts for Postman testing.

At least some of the most used by me :-)

Postman Objects

(pm-objects.js)

  • Global variables
  • Environment variables
@enhoang
enhoang / example.md
Created June 5, 2023 04:25 — forked from gghughunishvili/example.md
Postman pm.sendRequest example

To send a request via the sandbox, you can use pm.sendRequest.

pm.test("Status code is 200", function () {
    pm.sendRequest('https://postman-echo.com/get', function (err, res) {
        pm.expect(err).to.not.be.ok;
        pm.expect(res).to.have.property('code', 200);
        pm.expect(res).to.have.property('status', 'OK');
    });
});