Skip to main content

How to save requests to a collection and run them as a chain

Since app version 1.4.0

Save requests from the inspector's log to a collection and click "Run the chain": they go to the service in order, and a later request can take a value from an earlier answer, such as the id of the order just created. Collections work on the Pro and Ultra plans (what the inspector does for free).

How to build a collection​

  1. Open an HTTPS tunnel's "Requests" tab (how to open the inspector) and pick a row in the log.
  2. At the bottom of the request panel, click "⋯" → "To a collection…".
  3. Enter a "Collection name". If you already have collections, first pick "To a new one", or "To a collection" and choose it in "Collection".
  4. Click "Save". The inspector shows "Request saved to «…»".
  5. Add the other requests the same way. In the "Collections" view, the requests stand in the order they are sent: drag a row to change it.

Collections are kept on this computer and seen only by your account: up to 50 collections, up to 100 requests in each.

Create an empty collection with "Create a collection" in the "Collections" view. To add a request that isn't in the log:

  1. In the collection, click "New request". The "New request in the collection" window opens.
  2. Fill it in and click "Send and save". The request goes to the service, and its log row lands in the collection.

In the log's "New request" window, the "Save to a collection" switch does the same.

In the list, a collection's "⋯" → "Rename" changes its name, and "⋯" → "Delete" removes it with all its requests from this computer: they cannot be brought back.

How to pass a value from an answer​

  1. In the "Collections" view, on the request that needs the value, click "⋯" → "Edit request".
  2. Put a placeholder in its path, a header or the body, for example /orders/{{steps.1.json.id}}, and click "Save".

Placeholders:

  • {{steps.N.json.PATH}}: a JSON field of step N's answer, a dot path such as data.items[0].id;
  • {{steps.N.status}}: step N's status code;
  • {{steps.N.header.NAME}}: a header of step N's answer;
  • {{var.NAME}}: a collection variable.

Steps are counted from 1, in the collection's order. Variables are set with the { } button ("Variables") in the collection's header: "Add a variable", a name of Latin letters, digits and _, up to 40 characters. The request window lists other placeholders too, such as {{uuid}} and {{now}}.

How to run the chain​

  1. Open the collection in the "Collections" view: its requests are in the middle, the "Run" column on the right.
  2. In the "Run" column, click the ▶ "Run the chain" button.

The requests go one at a time, each after the answer to the one before. "Run" shows where it stands, for example "running · step 2 of 3", and each step's status code. When a placeholder has no value, the step says "nothing to fill in". While the chain runs, the button turns into "Stop". If a step gets an answer with a status of 400 or above, or no answer, the chain stops and says "error at step N".

Check​

When the chain reaches the end, "Run" says "went through". Each step is a new row in the log: click a step to open its row and check that the placeholder became the value from the answer.