Home / Companies / Postman / Blog / Post Details
Content Deep Dive

Send asynchronous requests with Postman’s PM API

Blog post from Postman

Post Details
Company
Date Published
Author
Joyce
Word Count
536
Company Posts That Month
8
Language
English
Hacker News Points
-
Post removed?
No
Summary

The Postman Sandbox is a JavaScript execution environment used for writing pre-request and test scripts in Postman and Newman, featuring the advanced pm.* API for enhanced scripting capabilities. The pm.* API, succeeding the older postman.* API, allows developers to access request and response elements, enforce testing rules, and manage environments and variables more efficiently. A key feature of this API is the pm.sendRequest() function, which enables asynchronous request sending, allowing scripts to execute without blocking subsequent tasks. Asynchronous JavaScript, while single-threaded, can process commands without delay, as demonstrated with functions like setTimeout(), offering the advantage of executing logic in the background for computational tasks or multiple requests. The pm.sendRequest() function takes a request and callback, handling errors and responses, and is applicable in both pre-request and test scripts, enhancing Postman's capability to handle use cases like authentication beyond the app's interface.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.