Opening the snippets panel
In any pre-request or post-response script editor, click the Snippets button in the toolbar above the editor. A panel opens with a search box at the top and a categorized list of snippets below.
rq.response is not available.
Searching for a snippet
Type in the search box to filter snippets by name. The list narrows to matches as you type. Clear the search to return to the full list.Inserting a snippet
Click any snippet name to insert its code at the current cursor position in the editor. The panel stays open so you can insert multiple snippets in one session.Available snippets
Tests
These snippets are available in post-response scripts only.Status code
Response body
Example - JSON schema validation:
Response headers
Response time
Variables
These snippets are available in both pre-request and post-response scripts.Get a variable
Set a variable
A common pattern is to extract a token from a response and store it for use in subsequent requests:
Clear a variable
Request / Other
These snippets are available in both phases unless noted.
Logs appear in the DevTools console tab, tagged with
#script. See DevTools for details.
Related pages
- Pre-request and Post-response Scripts - overview of the scripting system and the
rqAPI - Tests - running and viewing test results after a request
- Import packages into your scripts - use external libraries like
momentanduuidin scripts


