0

我正在尝试创建一个场景来获取访问令牌。从我的调试来看,它似乎Content-Type不起作用

scenarios:
  - flow:
      - log: "getting token"
      - post:
          url: "/....."
          headers:
            Content-Type: "application/x-www-form-urlencoded"
          form:
            grant_type: "password"
            response_type: "token"
            username: "Username"
            password: "password1234"
            client_id: "api"
            client_sercret: "clientsecret123"
          expect:
            - statusCode: 200

如果我更改formjson例如,我可以看到添加到请求中的正文。我认为 Content-Type 未被识别或form类型未按预期工作

请求是这样的:

  "url": "https://.......com",
  "method": "POST",
  "headers": {
    "user-agent": "Artillery (https://artillery.io)",
    "content-type": "application/x-www-form-urlencoded"

身体不包括在内

4

0 回答 0