Postman 获取返回值再放到下一个请求中

记录一个在 SO 上发的一个自问自答
read the source

Let's say I want to create a new obj called 'qif' then get its id, and then update it.

  1. In Postman open the first request - Test tab enter:
var jsonData = JSON.parse(responseBody);
pm.environment.set("new_create_qif_id", jsonData.id);
image.png
  1. after sending the request you will get the environment valuable new_create_qif_id ready.
image.png
  1. use {{new_create_qif_id}} in request body or URL, it will be updated every time we run the collection or folder
image.png

Requesting token is just the same.

你可能感兴趣的:(Postman 获取返回值再放到下一个请求中)