Compartir a través de


setRequestHeader Method (IXMLHTTPRequest)

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Specifies the name of an HTTP header.

Script Syntax

oXMLHttpRequest.setRequestHeader(bstrHeader, bstrValue);

Remarks

Script Parameters

  • bstrHeader
    String. Header name to set; for example, "depth". This parameter should not contain a colon and should be the actual text of the HTTP header.
  • bstrValue
    String. Value of the header; for example, "infinity".

Script Return Value

None.

C/C++ Syntax

HRESULT setRequestHeader(
  BSTR bstrHeader, 
  BSTR bstrValue
);

Remarks

C/C++ Parameters

  • bstrHeader
    [in] Header name to set, for example, "depth". This parameter should not contain a colon and should be the actual text of the HTTP header.
  • bstrValue
    [in] Value of the header, for example, "infinity".

C/C++ Return Values

  • S_OK
    Value returned if successful.
  • E_INVALIDARG
    Value returned if either input argument is NULL.

Requirements

Header msxml2.h, msxml2.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

General Remarks

If another header already exists with this name, it is replaced.

This method applies to the following interface:

IXMLHTTPRequest

See Also

Other Resources