【问题标题】:Artillery.io using Body url encoded form not working使用 Body url 编码形式的 Artillery.io 不起作用
【发布时间】:2022-01-06 17:26:25
【问题描述】:

值得注意的是,我的请求在 Postman 中有效。

我基本上有以下几点

scenarios:
  - name: 'Hit the Endpoint'
    flow:
      - log: "Hit the endpoint"
      - post:
          url: "/endpoint"
          headers:
            accept: application/jwt
            Content-Type: application/x-www-form-urlencoded
            cache-control: no-cache
          body:
            token: blah
            client_id: blah
            client_secret: blah
            token_type_hint: 'access_token'
          expect:
            - statusCode: 200
          capture:
            regexp: '[^]*'
            as: 'result'
      - log: 'result= {{result}}'

当我从 yaml 文件中删除正文时,端点似乎被击中并发回正确的消息。当我重新添加身体时,我得到以下信息:

vusers.created_by_name.Hit the Endpoint: .................... 5
vusers.created.total: ....................................... 5
vusers.failed: .............................................. 5
errors.ERR_GOT_REQUEST_ERROR: ............................... 5

【问题讨论】:

    标签: load artillery


    【解决方案1】:

    根据文档使用 form 而不是 Body

    https://www.artillery.io/docs/guides/guides/http-reference

    【讨论】:

    • 如果链接断开,那么你的答案就会变得不清楚。
    猜你喜欢
    • 2013-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-23
    • 1970-01-01
    • 2016-04-29
    • 1970-01-01
    相关资源
    最近更新 更多