IXMLHTTPRequest2 interface (msxml6.h)

Provides the methods and properties needed to configure and send HTTP requests and use callbacks to receive notifications during HTTP response processing.

Note  This interface is supported on Windows Phone 8.1.

 

Inheritance

The IXMLHTTPRequest2 interface inherits from the IUnknown interface. IXMLHTTPRequest2 also has these types of members:

Methods

The IXMLHTTPRequest2 interface has these methods.

 
IXMLHTTPRequest2::Abort

Cancels the current HTTP request.
IXMLHTTPRequest2::GetAllResponseHeaders

Retrieves the values of all the HTTP response headers.
IXMLHTTPRequest2::GetCookie

Gets a cookie associated with the specified URL from the HTTP cookie jar.
IXMLHTTPRequest2::GetResponseHeader

Retrieves the value of an HTTP header from the response headers.
IXMLHTTPRequest2::Open

Initializes an IXMLHTTPRequest2 request and specifies the method, URL, and authentication information for the request. After calling this method, you must call the Send method to send the request and data, if any, to the server.
IXMLHTTPRequest2::Send

Sends an HTTP request to the server asynchronously. On success, methods on the IXMLHTTPRequest2Callback interface implemented by the app are called to process the response.
IXMLHTTPRequest2::SetCookie

Sets a cookie associated with the specified URL in the HTTP cookie jar.
IXMLHTTPRequest2::SetCustomResponseStream

Provides a custom stream to replace the standard stream for receiving an HTTP response.
IXMLHTTPRequest2::SetProperty

Sets a property on an outgoing HTTP request.
IXMLHTTPRequest2::SetRequestHeader

Specifies the name of an HTTP header to be sent to the server along with the default request headers.

Remarks

The IXMLHTTPRequest2 interface is extended by the IXMLHTTPRequest3 interface. The IXMLHTTPRequest3 inherits all the methods and properties of the IXMLHTTPRequest2 interface.

The IXMLHTTPRequest2 interface configures and sends HTTP request operations and uses callbacks to receive notifications during response processing. The IXMLHTTPRequest2 allows applications to run in a Multi Threaded Apartment (MTA), a requirement for running under the Windows Runtime (WinRT).

The IXMLHTTPRequest2 interface supports the following features:

  • Set properties on outgoing HTTP requests.
  • Set cookies in the HTTP cookie jar for use in outgoing HTTP requests.
  • Get cookies from the HTTP cookie jar.
  • Process incoming HTTP response data before the HTTP response has finished downloading.
  • Create custom streams to receive HTTP responses.

IXMLHTTPRequest2 implements a callback model for event handling. Because IXMLHTTPRequest2 methods allow only asynchronous method calls, to receive completion callbacks an application must pass a pointer to an IXMLHTTPRequest2Callback object when it calls the IXMLHTTPRequest2::Open method to create an HTTP request.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps],MSXML 6.0 and later
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header msxml6.h

See also

IXMLHTTPRequest2Callback

IXMLHTTPRequest3

IXMLHTTPRequest3Callback

Quickstart: Connecting using XML HTTP Request (IXHR2)

XML HTTP Request 2 GET sample

XML HTTP Request 2 POST sample