0

值得注意的是,我的请求适用于 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
4

1 回答 1

0

使用form而不是Body按照文档

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

于 2022-01-06T17:33:22.250 回答