Düzenle

Aracılığıyla paylaş


IXMLHTTPRequest2::Send method (msxml6.h)

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

[in, optional] pBody

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.

[in] cbBody

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

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

IXMLHTTPRequest2