Skip to content

API

Scripting APIs are grouped by hc namespace (plus the capturing console object). Each page starts with conceptual notes (when present) and then the full method reference.

  • Request — Read and write the outgoing request. Available in both pre- and post-request scripts. Changes made in pre-request scr…
  • Collection — Collection metadata, variables, headers, and authorization for the request's owning collection. Available when the re…
  • Globals — Get and set app-wide global variables. Values set with hc.globals.set are persisted to Settings → Globals after…
  • Environment — Read and write variables on the active environment. Runtime values include the merged inheritance chain for that envi…
  • Cookies — Get, set, and clear cookies for the request host resolved at send start. Available in pre- and post-request scrip…
  • DataType: Record<string, unknown> (get/set)
  • fetch
  • ask
  • sleep
  • send
  • sendJSON
  • livePage
  • FSType: filesystem API (async)
  • parseType: in-memory codecs (async)
  • stringifyType: in-memory codecs (async)
  • Execution — Control collection-run and workflow playback flow from pre- and post-request scripts.
  • info
  • test
  • expect
  • ResponseAvailable in post-request scripts only. Not defined during pre-request scripts.
  • console — Scripts get a capturing console object aligned with the web Console API. Log lines are shown in the send Console an…