Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.83 KB

httpclient_trygetasync_641528473.md

File metadata and controls

35 lines (24 loc) · 1.83 KB
-api-id -api-type ms.custom
M:Windows.Web.Http.HttpClient.TryGetAsync(Windows.Foundation.Uri,Windows.Web.Http.HttpCompletionOption)
winrt method
19H1

Windows.Web.Http.HttpClient.TryGetAsync

-description

Sends a GET request to the specified Uri as an asynchronous operation. For programming guidance for the HttpClient class, and code examples, see the HttpClient conceptual topic.

-parameters

-param uri

The Uri the request is sent to.

-param completionOption

An HTTP completion option value that indicates when the operation should be considered completed.

-returns

The object representing the asynchronous operation.

-remarks

This operation will not throw an exception on network errors. Instead you should examine the HttpRequestResult to learn about the original HTTP request, the resulting HTTP response (if any) and error (if any). This operation will throw when the operation is canceled.

This operation will not block. The returned IAsyncOperationWithProgress (of HttpRequestResult and HttpProgress) completes based on the completionOption parameter after part or all of the response (including content) is read.

-see-also

HttpRequestResult, HttpCompletionOption, HttpProgress, HttpResponseMessage, HttpClient

-examples