Export (0) Print
Expand All

IXMLHTTPRequest2Callback::OnResponseReceived method

Occurs when a client has received a complete response from the server.

Syntax


HRESULT OnResponseReceived(
  [in, optional]  IXMLHTTPRequest2 *pXHR,
  [in, optional]  ISequentialStream *pResponseStream
);

Parameters

pXHR [in, optional]

The initial HTTP request object

pResponseStream [in, optional]

The response stream being received. The client can call ISequentialStream::Read to begin processing the data, or it can store a reference to pResponseStream for later processing. This response stream is wrapped in a stream synchronization object that prevents concurrent read and write operations, so the application does not need to implement custom synchronization.

Return value

Returns S_OK on success.

Note  This callback function must not throw exceptions.

Remarks

When this event fires the application can begin processing data from the HTTP response. Processing may begin before this event fires if an earlier OnDataAvailable event has occurred.

Unless OnError is called, the call to OnResponseReceived is the final callback. The client should perform any required cleanup including releasing references to the IXMLHTTPRequest2 object.

Custom streams receive a call to ISequentialStream::Write specifying 0 bytes written before OnResponseReceived is fired. The client can process data directly from the Write call instead of calling ISequentialStream::Read on the custom stream, and it can rely on the zero-byte Write call to indicate that the response has been received.

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

ISequentialStream Interface
IXMLHTTPRequest2Callback

 

 

Community Additions

ADD
Show:
© 2014 Microsoft