Reputation: 23
I create in postman request - {"name": "Tom"}. The user is created. In the Body section I have this record: { "id": "32esd", "name": "Tom" } I would like to get a body to ID and use it in another query. Where he tests the editing option.
How can I do this in postman? Thank you for your help.
Upvotes: 0
Views: 903
Reputation: 16226
You can use Postman to chain several HTTP requests together, with variables (such as "global variable" or "environment variable") to save result of one request, and use it in the next one.
First, in the request that create the user and receive id
, set variable in its "Tests" panel (take global variable for example):
Then, you can use this global variable in subsequent requests. In URL of GET
request for example:
Or, in the body of another POST request:
There are several types of variable and many related features in Postman, you can check the document and pick the most appropriate one.
Upvotes: 3