C# 14 · Async, errors and resources
Write an async method
Await I/O without blocking a thread. Async methods return Task or Task<T>.
async Task<string> GetAsync(HttpClient http, string url)
{
return await http.GetStringAsync(url);
}
C# 14 · Async, errors and resources
Await I/O without blocking a thread. Async methods return Task or Task<T>.
async Task<string> GetAsync(HttpClient http, string url)
{
return await http.GetStringAsync(url);
}
Was this page helpful?