The other day I was supporting a client in my day job by helping him use Postman to generate HTTP Post requests. The problem was, that his language of choice was Dart, a language I had never heard of, much less used. I’ve worked with Postman for quite some time, but I never clicked this discrete link to the right of the request.
Imagine my surprise when I clicked that link and a code snippet showing the Dart code.
It generates cURL requests,
Python code snippets,
Node.js code snippets,
and many more. For example, Postman can generate snippets for over 30 different languages or frameworks.
How to Generate Python Code Snippets
Create the request you desire, for example, the following is a simple GET request listing available APIs on the API Guru website.
- Click the small Code generate button.
- Select your desired language or framework.
- Click the copy icon to copy the code snippet to your clipboard.
Here’s a video by a member of the Postman team showing how to use the code snippet generation feature.