美文网首页《Django By Example》
Postman 获取返回值再放到下一个请求中

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

作者: 思考的虫子 | 来源:发表于2019-08-22 05:48 被阅读0次

记录一个在 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 获取返回值再放到下一个请求中

    本文链接:https://www.haomeiwen.com/subject/pfhgsctx.html