When a body needs computed fields, conditional parts, escaping or data from earlier responses, build it as a JavaScript object and send it with pm.request.body.raw. Patterns for totals, optional fields, dates and signatures.
Testing only the first item of a list misses the broken one on page three. Script patterns that check every item, name the one that failed, and stay fast on large responses.
A list that's sorted on page one and shuffled on page two, or that repeats a record, breaks every client that pages through it. Script checks for sort order, uniqueness and stable ordering.
Catch unexpected changes by comparing a response with a known-good one, field by field, while ignoring ids and timestamps. Works across environments too, such as staging against production.
A collection run goes top to bottom, unless a script says otherwise. Use pm.execution.setNextRequest to poll until a job is done, skip requests, branch on a response, or stop the iteration.
Some checks only make sense in one environment, such as seeded test data on staging or a strict latency budget in production. How to keep one collection and still vary what it checks.
Values that scripts set during a run are gone when it ends. When you really need one in the next run (a created account, a cursor, a last-seen id), save it on purpose with the CLI, and when you don't, make each run start clean.
One script that behaves differently on the first iteration, names tests after the data row, and works in a folder of many requests. What pm.info and pm.iterationData give you, with examples.
pm.sendRequest doesn't run in Requestarium yet. Four patterns that replace it, usually with less code: a token request, built-in OAuth 2.0, setup steps and a loop with setNextRequest.
A tour of the request script editor in Requestarium. Script phases per protocol, the Snippets and Packages menus, autocomplete for cm and pm, and the three packages scripts can require.
Variables hold text, so an object saved with pm.environment.set comes back as a JSON string. How to save whole objects and lists, read them in later scripts, and use them in request bodies.
Headers carry the next page link, the rate limit left, the request id and the new resource's URL. How to read them in scripts, check them, and pass them to the next request.
{{variables}} are replaced as plain text, so where you put the quotes decides whether a value becomes a string, a number or an array. The rules, the common breakages, and how to build tricky bodies safely in a script.
A script that sets the wrong variable or fails one test out of twenty is hard to see from the results alone. Where console output goes in the app, the IDEs and the CLI, and the logging habits that make script bugs obvious.
Copying the same bearer token, base URL and login script into fifty requests is how collections go stale. What a collection or folder can define for everything inside it, in what order it applies, and how a request overrides it.
Many APIs want each request signed with a shared secret, a timestamp and a hash of the body. How to build the signature with crypto-js in a pre-request script, keep the secret out of the collection, and debug a signature mismatch.
Export endpoints are tested less than JSON ones and break in Excel first. How to check the header row, quoting, encoding, row counts and the download headers of a CSV response with a post-response script.
Every Requestarium CLI run can write a stable JSON report. Use jq to list failures, find the slowest requests, spot unresolved variables, and feed results into your own tools.
Off-by-one days, midnight in the wrong zone, daylight saving gaps and timestamps without offsets. The date cases every API should be tested with, and scripts that check formats with moment.
Decode a JWT in a test script, check its claims, and send the tokens an API must reject: expired, unsigned, re-signed, for another audience. Plus how to refresh a token before it expires mid-run.
Pagination bugs hide at the edges, on the last page, an empty page or when data changes between pages. How to test offset, page and cursor pagination with a few requests and scripts.
Retries are safe only if your API handles them. How to test idempotency keys on create and payment endpoints, including same key with a different body, concurrent retries and key expiry.
Test your webhook endpoint the way the sender calls it, with signed payloads, retries, duplicates and events out of order. Includes an HMAC signing script you can adapt to Stripe-, GitHub- or Shopify-style signatures.
Log in once, store the token from the response, and use it in every request after it. Plus passing IDs between requests, in the app, in collection runs and in CI.
Copy-paste examples for testing status codes, headers, JSON bodies, arrays, types and response shape with pm.test and pm.expect, in Postman-compatible scripts.
Which Postman pre-request and test script calls run unchanged in Requestarium, which legacy calls are converted, and which have no counterpart yet, with workarounds.
Real-world pre-request scripts for API testing. HMAC request signing, timestamps and nonces, correlation IDs, computed headers and dates, with the crypto-js, moment and uuid libraries.