Postman Cheatsheet - API Debugging Tool Reference
A single curl proves nothing about auth edge cases or response shapes across environments. Postman turns requests into an environment-aware, scriptable workflow. This reference covers building requests, environment and global variables, test assertions with pm.test, pre-request scripts and dynamic data, plus running whole collections and spinning up Mock servers. Use it when you need repeatable tests for many endpoints, not one-off probes. After reading you automate assertions and re-run suites across dev/staging/prod.
Request Building 7
GET {{base_url}}/api/usersPOST {{base_url}}/api/usersPUT {{base_url}}/api/users/1DELETE {{base_url}}/api/users/1Headers: Content-Type: application/jsonBody → raw → JSONAuthorization: Bearer {{token}}Environment Variables 6
{{base_url}}pm.environment.set("token", "xxx")pm.environment.get("token")pm.environment.unset("token")pm.globals.set("key", "value")pm.variables.get("key")Test Scripts 6
pm.test("Status is 200", () => { pm.response.to.have.status(200) })pm.expect(pm.response.json().name).to.eql("Alice")pm.response.to.be.jsonpm.response.to.have.header("Content-Type")pm.expect(pm.response.responseTime).to.be.below(500)const json = pm.response.json()Pre-request Scripts 4
pm.request.headers.add({key: "X-Token", value: "xxx"})pm.request.body.update("new body")const timestamp = Date.now(); pm.environment.set("ts", timestamp)pm.request.url.addQueryParams({page: 1})Collections & Runner 7
Collection RunnerNew RunnerSet Data File (CSV/JSON)Delay: 1000msIterations: 10Export CollectionImport from cURL / OpenAPIMock & Docs 5
Mock ServerExample ResponsesDocumentationPublish DocumentationMonitorTips
- Variables come in Environment (current) and Global; put secrets in Environment.
- Collection Runner plus a CSV data file enables data-driven testing.
- Mock Server suits parallel frontend dev when the backend isn't ready yet.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us