Contents tagged with HTTP
-
Caching HttpClient Requests
The HttpClient class is Microsoft’s recommended approach for making raw HTTP calls in .NET. It allows you to send arbitrary HTTP requests (including headers) through a request/response pipeline of message handlers. These handlers can be used to augment the request and response messages and add additional policies, such as retrying operations, handling errors, and so on. One thing that is missing from the out-of-the box behaviours is caching of GET requests (only ones that can be cached!), and that’s what I’ll be talking about here. The concepts introduced in this post will be used in a few days in another one, so please keep an open eye!