Skip to content

What gets applied back

After each script runs, HarborClient applies these changes:

ChangeApplied to sent requestPersists to saved request
hc.request.method, url, bodyYes (pre scripts only)No (current send only)
hc.request.headers / hc.request.paramsYes (pre scripts only)No (current send only)
hc.request.notesN/A (not sent over HTTP)Yes (tags and comment on saved request)
hc.request.auth.set / updateYes (pre scripts only)No (current send only)
hc.request.variables.setYes (via {{key}} substitution)No (session only)
hc.request.variables.clearYes (via {{key}} substitution)No (session only)
hc.collection.variables.setYes (via {{key}} substitution)Yes (collection variables)
hc.collection.variables.clearYes (via {{key}} substitution)Yes (collection variables)
hc.collection.headersYes (collection headers on send)Yes (collection headers)
hc.collection.auth.set / updateYes (collection auth on send)Yes (collection authorization)
hc.environment.variables.setYes (via {{key}} substitution)Yes (active environment variables)
hc.environment.variables.clearYes (via {{key}} substitution)Yes (active environment variables)
hc.globals.setYes (via {{key}} substitution)Yes (app global variables)
hc.globals.clearYes (via {{key}} substitution)Yes (app global variables)
hc.cookies.set / clearYes (Cookie header on send)Yes (cookie jar for request host)
hc.data mutationsN/ANo (session only)
hc.execution.skipRequestSkips HTTP send when set in preN/A
hc.execution.setNextRequestN/A on manual sendControls next step in collection run only
hc.execution.workflowSkipActionSkips HTTP send when set in preN/A; advances workflow playback
hc.execution.workflowNextActionN/A on manual sendJumps to a workflow action by UUID
hc.send / hc.sendJSONReplaces displayed responseN/A (does not skip HTTP by itself)
hc.fetchSeparate outbound HTTPN/A (does not modify the active request)
hc.fs read/writeN/AFiles under the script root on disk
hc.parse / hc.stringifyN/AN/A (in-memory only)
hc.test resultsN/AShown in response viewer
console.*N/AShown 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:

  1. Value set with hc.request.variables.set during this send
  2. Merged active environment chain value (or default if the value is empty)
  3. Folder variable value (or default if the value is empty), when the request is in a folder
  4. Collection variable value (or default if the value is empty)
  5. Global variable value (or default if the value is empty)

Variable resolution order for hc.collection.variables.get:

  1. Value set with hc.collection.variables.set during this send
  2. Merged runtime variable value (global, collection, folder, and environment chain, same order as above)

Variable resolution order for hc.environment.variables.get:

  1. Value set with hc.environment.variables.set during this send
  2. Merged runtime variable value (global, collection, folder, and environment chain, same order as above)

Variable resolution order for hc.globals.get:

  1. Value set with hc.globals.set during this send
  2. 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.