Utils.addAutoHeader
Adds an HTTP header to every consecutive HTTP request following this function call.
Utils.addAutoHeader(header, value, merge);
Arguments
Name | Description |
---|---|
header | (string) The name of the header to be added. |
value | (string) The value of the header to be added. |
merge | (boolean) A true setting indicates to merge the value with an existing header with the same name; false indicates to overwrite it. Note: The following headers cannot be modified by the merge argument: content-type, content-disposition, content-length, user-agent, referer, host, authorization, proxy-authorization, if-modified-since, if-unmodified-since, from, location, max-forwards |
Return value
A promise that is fulfilled with undefined upon success.
Example
(async ()=>{
await Utils.addAutoHeader("someCustomHeader", "someValue", true);
})();