Dela via


HttpClient.GetInputStreamAsync(Uri) Method

Definition

Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation. For programming guidance for the HttpClient class, and code examples, see the HttpClient conceptual topic.

public:
 virtual IAsyncOperationWithProgress<IInputStream ^, HttpProgress> ^ GetInputStreamAsync(Uri ^ uri) = GetInputStreamAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<IInputStream, HttpProgress> GetInputStreamAsync(Uri const& uri);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<IInputStream,HttpProgress> GetInputStreamAsync(System.Uri uri);
function getInputStreamAsync(uri)
Public Function GetInputStreamAsync (uri As Uri) As IAsyncOperationWithProgress(Of IInputStream, HttpProgress)

Parameters

uri
Uri Uri

The Uri the request is sent to.

Returns

The object representing the asynchronous operation.

Attributes

Remarks

This operation will not block. The returned IAsyncOperationWithProgress (of IInputStream and HttpProgress) completes after the whole response body is read. This method does not buffer the stream, so this method can support long streams of arbitrary length.

Below are the exceptions that this function throws.

E_INVALIDARG

The uri parameter was a null reference (Nothing in Visual Basic).

Applies to

See also