On this page
HTTP & JSON
httpAddHeader
$httpAddHeader[]
Adds a custom HTTP header to all subsequent HTTP requests made with $httpGet, $httpPost, $httpPut, $httpPatch, or $httpDelete
Syntax
$httpAddHeader[name;value]
$httpAddHeader sets a custom HTTP header that is included on all subsequent HTTP requests until cleared or overwritten. Call it multiple times to set multiple headers. Headers are applied to every request made via $httpGet, $httpPost, $httpPut, $httpPatch, and $httpDelete. Common use cases include setting Content-Type for JSON APIs, Authorization for authenticated endpoints, and custom headers for API-specific requirements. Headers persist for the duration of the command execution context.