Share via

HttpClient.TryGetInputStreamAsync(Uri) Method


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.

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


Uri Uri

The Uri the request is sent to.


The object representing the asynchronous operation.


Windows requirements

Device family
Windows 10, version 1903 (introduced in 10.0.18362.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v8.0)


This operation will not block. The returned IAsyncOperationWithProgress (of HttpGetInputStreamResult 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.

Applies to

See also