Developing Microsoft Azure and Web Services — Question 52

You are developing a web application by using Microsoft .NET Framework 4.5.
You are creating a web client for the application. The web client will make REST calls to several web services.
You need to ensure that the web client meets the following requirements:
✑ Uses the Task class to perform asynchronous operations
✑ Reuses recently resolved DNS lookups
Which object should you include in the solution?

Answer options

Correct answer:

Explanation

The correct answer is HttpClient because it is designed for making HTTP requests and supports asynchronous operations using the Task class. It also reuses DNS lookups, improving performance. Other options like WebClient and WebRequest do not provide the same level of support for asynchronous programming and DNS caching.