setRequestHeader method
Adds custom HTTP headers to the request.
Syntax
HRESULT retVal = object.setRequestHeader(bstrHeader, bstrValue);
Parameters
- bstrHeader [in]
-
Type: BSTR
BSTR that specifies the header name.
- bstrValue [in]
-
Type: BSTR
BSTR that specifies the header value.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
- XMLHttpRequest, Section 3.6.2
Remarks
Refer to RFC2616, Section 14: Header Field Definitions for a general list of standard headers. The server is ultimately responsible for honoring the headers of the request. By far the most common request header is Content-Type, which is required by some XML Web services.
IHTMLXMLHttpRequest::setRequestHeader was introduced in Windows Internet Explorer 7.
See also
Build date: 11/12/2012