Зміст курсу
Introduction to .NET with C#
Introduction to .NET with C#
Making a GET Request
Important Points
- We use the HttpClient class to make Get requests;
GetAsync
is an asynchronous method and should be used as such;- The
GetAync
method returns aHttpResponseMessage
object; - We can access the returned content using the
ReadAsStringAsync
method of theContent
attribute fromHttpResponseMessage
:response.Content.ReadAsStringAsync()
.
Дякуємо за ваш відгук!