Bearer header in every subsequent request — without any manual copy-and-paste.
Script Format
Post-response scripts are stored as a JSON array on the request record (columnscriptsJson). Each element is an object with two fields:
key or empty path are silently skipped.
JSONPath Syntax
Xolo uses thejson_path Dart package for JSONPath evaluation. Expressions follow standard JSONPath notation:
When a path matches multiple nodes,
ScriptExecutor uses the first match. If the path matches nothing, the variable is set to the sentinel value '[No Match]' rather than being omitted, so you can immediately see in the UI that the extraction failed.
ScriptExecutor.testPostScripts() Signature
CollectionRunnerService._applyPostScripts()) calls XoloRepository.upsertVariable() for every successfully matched value.
Live Testing
The Scripts tab provides a Test button (▶) in the Post-Request section header. Tapping it callstestPostScripts() against the most recently received response body — the request is not re-sent. Each extraction rule row displays the matched result inline beneath it, highlighted in orange for a match or red for an error, so you can iterate on your JSONPath expressions rapidly without consuming API rate limits.
Request Chaining
When you send a request from the composer, successfully matched values are upserted into the active environment viaXoloRepository.upsertVariable(). This means subsequent requests in the same session will resolve {{authToken}} (or whatever key you chose) from the environment automatically, without any additional configuration.
A complete token-chaining workflow looks like this:
authToken and currentUserId are live in the environment. Any subsequent request can reference them:
Collection Runner Integration
When the collection runner executes a step, post-scripts run after assertions are evaluated and before the next step begins. Extracted values are merged into the sharedworkingVars map that flows through the entire run:
_applyPostScripts both updates workingVars for the next iteration of the loop and persists each matched value to the database via upsertVariable, so the extracted token survives even if the run is interrupted.
Variable extraction from one step flows into the next, enabling full authentication + resource workflows. For example: step 1 logs in and captures
{{authToken}}; step 2 creates a resource using that token and captures {{resourceId}}; step 3 fetches and asserts on that resource.