XMLHttpRequest.setRequestHeader()

Draft
This page is not complete.


The XMLHttpRequest.setRequestHeader() method sets the value of an HTTP request header. You must call setRequestHeader()after open(), but before send(). If this method is called several times with the same header, the values are merged into one single request header.

void setRequestHeader(
   DOMString header,
   DOMString value
);

For security reasons, some headers can only be controlled by the user agent. These headers include the forbidden header names  and forbidden response header names.

Parameters
header
The name of the header whose value is to be set.
value
The value to set as the body of the header.

Document Tags and Contributors

 Contributors to this page: jsx
 Last updated by: jsx,