1

我正在尝试从 API 响应中捕获 cookie 值,但用户在运行命令后失败。

config:
  target: "URL"
  phases:
    - duration: 100
      arrivalRate: 10

scenarios:
  - name: "Login and fetch the token"
    flow:
      - log: "Login and Fetching the token"
      - post:
          url: "/api/v1/login/"
          json:
            username: "username"
            password: "password"
          capture:
            - cookie: "csrftoken"
              as: fooBody
      - log: "{{ fooBody }}"
4

0 回答 0