Realizando uma Solicitação GET
Video Player is loading.
Loaded: 0%
Current Time 0:00
/
Duration -:-
- , opens subtitles settings dialogsubtitles settings
- subtitles off
- , selectedPortuguese Captions
1x
- 2x
- 1.5x
- , selected1x
- 0.5x
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Beginning of dialog window. Escape will cancel and close the window.
End of dialog window.
Pontos Importantes
Utiliza-se a classe HttpClient para realizar requisições Get;
GetAsync
é um método assíncrono e deve ser utilizado como tal;O método
GetAync
retorna um objetoHttpResponseMessage
;É possível acessar o conteúdo retornado utilizando o método
ReadAsStringAsync
do atributoContent
deHttpResponseMessage
:response.Content.ReadAsStringAsync()
.
1. O que pode ser utilizado para criar um cliente em uma aplicação de console C#?
2. Qual tipo é retornado pelo método GetAsync do HttpClient?
3. Qual método deve ser utilizado para realizar requisições HTTP GET assíncronas com HttpClient?
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 2. Capítulo 5
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo