【问题标题】:How to add request parameters for a postman request in pre-script request如何在前置脚本请求中为邮递员请求添加请求参数
【发布时间】:2020-07-11 18:55:05
【问题描述】:

我想通过预请求脚本在邮递员中为我的请求添加查询参数。我该怎么做?

【问题讨论】:

  • 请您详细说明想要这样做的原因吗?
  • 我想将它添加到集合的预请求脚本中,而不是为所有 API 手动添加

标签: javascript postman postman-pre-request-script


【解决方案1】:

类似这样的基本内容可以在集合Pre-request Script中使用:

pm.request.url.query.add({key: 'test', value: '1234'})

【讨论】:

    猜你喜欢
    • 2021-07-13
    • 2020-03-11
    • 1970-01-01
    • 2015-10-26
    • 1970-01-01
    • 1970-01-01
    • 2020-12-13
    • 2017-06-17
    • 2020-12-12
    相关资源
    最近更新 更多