Content-Negotiation in ASP.NET via Codecs
Content Negotiation is a powerful and core part of HTTP, but vastly under-utilized in ASP.NET Web APIs.
This post covers what it is and why you should use it. We also shop for donuts.
Part 1/5 – Content Negotiation Series
In this post, we’ll explore how ASP.NET implements content negotiation. I’ll show how to customize the behavior and get full control. The associated example code shows how to use what ASP.NET Core provides, but please stick around for part 3-5, where we make things much better.
Part 2/5 – Content Negotiation Series
This post introduces Codecs and the Transcoder. These extract and decouple the encoding / decoding from of the ASP.NET pipeline, making them reusable and testable. Our goal is to overcome the challenges noted in part 2 of this series.
Part 3/5 – Content Negotiation Series
Let’s reuse the Codecs and the Transcoder for an HTTP client to leverage our investment for good return on our investment.
Part 4/5 – Content Negotiation Series
This post reuses a Transcoder and Codecs to encode and decode resources into documents for database persistence.
Part 5/5 – Content Negotiation Series