Insomnia allows chaining requests, or the ability to extract values from the responses of other requests. Values are passed using Template Tags and Environment Variables.
The following are common use cases for chaining requests:
/items
in PUT /items/{id}
In an empty URL bar or following a URL symbol such as /
or =
, either press CTRL+Space to open the autocomplete dropdown or start typing “response”.
There are three response options:
Works on JSON and XML responses, pulling attributes from a response body.
Use either JSONPath or XPath queries (depending on the Content-Type) to extract specific attributes from a response body. For example, a login request may respond with a JSON object that looks like {"auth_token": "secret-token"}
. This allows you to use a JSONPath filter of $.auth_token
to reference the token itself in a subsequent request.
The Response tag can be used anywhere Environment Variables are supported.
Click on the tag in the URL bar to configure it. An Edit Tag modal will open. Select options from the first four fields:
In the Edit Tag modal, customize the tag functionality.