Skip to content

Response Storage

Use one response in the next request.

Store values from a response — a body field, a header, the status — and reference them later as ${store.name}. Chain create-then-read, log in once and reuse the token, all in one file.

signup.yaml
requests:
  - name: Create user
    url: https://api.example.com/users
    method: POST
    headers:
      Content-Type: application/json
    body: { name: Ada }
    store:
      userId: body.id
      requestId: headers.x-request-id

  - name: Fetch the new user
    url: https://api.example.com/users/${store.userId}
    headers:
      X-Request-ID: ${store.requestId}
    expect:
      status: 200

Benefits

  • Real workflows

    Create a resource, then read, update and delete it using the ID the API just returned.

  • Any part of the response

    Paths like body.data.items[0].id, headers.x-request-id and status pick exactly the value you need.

  • Plain interpolation

    ${store.name} works anywhere a variable does — URLs, headers, bodies — in sequential runs, the default.

Good for

  1. Login flows that hand out a token
  2. CRUD tests that need a fresh ID
  3. Following a pagination cursor
  4. Correlating requests by ID