Compartilhar via


setRequestHeader Method (IXMLHTTPRequest) (Compact 2013)

3/26/2014

Specifies the name of an HTTP header.

Syntax

oXMLHttpRequest.setRequestHeader(bstrHeader, bstrValue);
HRESULT setRequestHeader(
  BSTR bstrHeader, 
  BSTR bstrValue
);

Parameters

Script

  • 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".

C/C++

  • 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".

Return Value

Script

None.

C/C++

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

Remarks

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

This method applies to the following interface:

IXMLHTTPRequest

Requirements

Header

msxml2.h,
msxml2.idl

Library

uuid.lib

See Also

Reference

XML HTTP Methods