What gets applied back
After each script runs, HarborClient applies these changes:
| Change | Applied to sent request | Persists to saved request |
|---|---|---|
hc.request.method, url, body | Yes (pre scripts only) | No (current send only) |
hc.request.headers / hc.request.params | Yes (pre scripts only) | No (current send only) |
hc.request.notes | N/A (not sent over HTTP) | Yes (tags and comment on saved request) |
hc.request.auth.set / update | Yes (pre scripts only) | No (current send only) |
hc.request.variables.set | Yes (via {{key}} substitution) | No (session only) |
hc.request.variables.clear | Yes (via {{key}} substitution) | No (session only) |
hc.collection.variables.set | Yes (via {{key}} substitution) | Yes (collection variables) |
hc.collection.variables.clear | Yes (via {{key}} substitution) | Yes (collection variables) |
hc.collection.headers | Yes (collection headers on send) | Yes (collection headers) |
hc.collection.auth.set / update | Yes (collection auth on send) | Yes (collection authorization) |
hc.environment.variables.set | Yes (via {{key}} substitution) | Yes (active environment variables) |
hc.environment.variables.clear | Yes (via {{key}} substitution) | Yes (active environment variables) |
hc.globals.set | Yes (via {{key}} substitution) | Yes (app global variables) |
hc.globals.clear | Yes (via {{key}} substitution) | Yes (app global variables) |
hc.cookies.set / clear | Yes (Cookie header on send) | Yes (cookie jar for request host) |
hc.data mutations | N/A | No (session only) |
hc.execution.skipRequest | Skips HTTP send when set in pre | N/A |
hc.execution.setNextRequest | N/A on manual send | Controls next step in collection run only |
hc.execution.workflowSkipAction | Skips HTTP send when set in pre | N/A; advances workflow playback |
hc.execution.workflowNextAction | N/A on manual send | Jumps to a workflow action by UUID |
hc.send / hc.sendJSON | Replaces displayed response | N/A (does not skip HTTP by itself) |
hc.fetch | Separate outbound HTTP | N/A (does not modify the active request) |
hc.fs read/write | N/A | Files under the script root on disk |
hc.parse / hc.stringify | N/A | N/A (in-memory only) |
hc.test results | N/A | Shown in response viewer |
console.* | N/A | Shown in send console / Logs tab |
Request body type is not modified by scripts. Post-request changes to hc.request do not trigger a second send.
Variable resolution order for hc.request.variables.get:
- Value set with
hc.request.variables.setduring this send - Merged active environment chain value (or default if the value is empty)
- Folder variable value (or default if the value is empty), when the request is in a folder
- Collection variable value (or default if the value is empty)
- Global variable value (or default if the value is empty)
Variable resolution order for hc.collection.variables.get:
- Value set with
hc.collection.variables.setduring this send - Merged runtime variable value (global, collection, folder, and environment chain, same order as above)
Variable resolution order for hc.environment.variables.get:
- Value set with
hc.environment.variables.setduring this send - Merged runtime variable value (global, collection, folder, and environment chain, same order as above)
Variable resolution order for hc.globals.get:
- Value set with
hc.globals.setduring this send - Merged runtime variable value (global, collection, folder, and environment chain, same order as above)
See Environments for how global, collection, folder, and environment inheritance are merged at send time.
