IXMLHTTPRequest2::Send method

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.

Syntax


HRESULT Send(
  [in, optional]  ISequentialStream *pBody,
  [in]            ULONGLONG cbBody
);

Parameters

pBody [in, optional]

The body of the message being sent with the request. This stream is read in order to upload data for non-GET requests. For requests that do not require uploading, set this parameter to NULL.

cbBody [in]

The length, in bytes, of the message being sent with the request. For requests that do not require uploading, set this parameter to 0.

Return value

Returns S_OK on success.

Remarks

The Open method must be called before Send can be called successfully.

Because this method is asynchronous, it returns immediately before the request has started processing. The application will be notified through the IXMLHTTPRequest2Callback interface as progress is made in the request processing.

Alternatives to using ISequentialStream for a POST request include SHCreateMemStream/SHCreateStreamOnFile for desktop apps, and CreateStreamOverRandomAccessStream for Windows Store apps.

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

IXMLHTTPRequest2

 

 

Community Additions

ADD
Show:
© 2014 Microsoft