CHAPTER 4

image

HttpClient

During the previous two chapters we’ve learned some important basics about asynchronous programming in .NET and the HTTP protocol. This is the first chapter that makes use of both foundations by introducing the HttpClient class; this class provides a way to handle HTTP requests and responses in .NET asynchronously on the client side (a server could also be a client). Before using HttpClient itself, let’s look at some new classes being used within both the HttpClient class and the ASP.NET Web API framework.

Commonalities: HTTP in ASP.NET Web API and HttpClient

You learned in Chapter 3 that HTTP, a network transfer protocol, ...

Get Pro ASP.NET Web API: HTTP Web Services in ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.