Contenido del Curso
Introduction to .NET with C#
2. Asynchronous Programming and Introduction to Web Services
3. Introduction to Databases with .NET
Introduction to .NET with C#
Making a GET Request
In terms of APIs, an endpoint is the same as a URL.
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()
.
1. What can be used for creating a client in a C# console application?
2. What type does the GetAsync method of HttpClient return?
3. What method should be used for making asynchronous HTTP GET requests with HttpClient?
¿Todo estuvo claro?
Sección 2. Capítulo 5
Contenido del Curso
Introduction to .NET with C#
2. Asynchronous Programming and Introduction to Web Services
3. Introduction to Databases with .NET
Introduction to .NET with C#
Making a GET Request
In terms of APIs, an endpoint is the same as a URL.
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()
.
1. What can be used for creating a client in a C# console application?
2. What type does the GetAsync method of HttpClient return?
3. What method should be used for making asynchronous HTTP GET requests with HttpClient?
¿Todo estuvo claro?
Sección 2. Capítulo 5