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

Parameters

uri
Uri Uri

The Uri the request is sent to.

Returns

The object representing the asynchronous operation.

Attributes

Windows requirements

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

Remarks

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