Skip to main content
C# / .NET Code Completion Easy +10 XP

Async Method

Complete the async method signature.

C# / .NETFill in the blank
public ___ Task<string> GetDataAsync() {
  return await httpClient.GetStringAsync(url);
}

Type the missing code

Show answer and explanation

Answer: async

The async keyword enables the use of await inside a method. It's required for methods that perform asynchronous operations.

Hint: What keyword enables await?

What this challenge tests

Code Completion in C# / .NET: async, tasks.

Related challenges