Expand Minimize

IXMLHTTPRequest2 interface

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.

Members

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

Methods

The IXMLHTTPRequest2 interface has these methods.

MethodDescription
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

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Version

MSXML 6.0 and later

Header

Msxml6.h

IDL

Msxml6.idl

See also

IXMLHTTPRequest2Callback
IXMLHTTPRequest3
IXMLHTTPRequest3Callback
Quickstart: Connecting using XML HTTP Request (IXHR2)
Web authentication sample

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.