setRequestHeader method (XMLHttpRequest)
Adds an HTTP header with the specified name and value to the request.
Request headers contain information about the sender, body of the request and required response.
You can find the related objects in the Supported by objects section below.
Required. String that specifies the name of the request header to send.
The following list contains some of the commonly used names. If you need a detailed list, please visit the HTTP request headers (Wikipedia) page.
|Required. String that specifies the value of the HTTP request header.|
This method has no return value.
Example HTML code 1:
This example illustrates the use of the setRequestHeader method:
Did you find this example helpful?
User Contributed Comments