Create API with ASP.NET Core (Day 4): Working with Serializer Settings And Content Negotiation In ASP.NET Core API


Introduction

This article of the series “Web API with ASP.NET Core” will focus on topics like serializer strings and content negotiation. We learned how to deal with HTTP Status Codes and return sub resources in ASP.NET Core in last article and paused at Serializer Settings. We’ll continue to explore the importance of status codes and practical examples as well. We’ll also explore resource creation and returning the child resources as well in this article. We can use the same source code as we got at the completion of last article of the series.

Continue reading “Create API with ASP.NET Core (Day 4): Working with Serializer Settings And Content Negotiation In ASP.NET Core API”

Advertisements

Formatters And Content Negotiation In ASP.NET Web API 2


Introduction

As the title suggests, this article will focus on the practical aspects of the formatters and the content negotiation in ASP.NET Web API. This article will explain what content negotiation is and why it is necessary, and how to achieve and get it working in ASP.NET Web API. The article will focus more on the implementation part of the content negotiation in Web API. The first part of the article will focus on the formatters, where it is described, how to support XML or JSON formats in Web API and how to format the result of the API. We’ll take a sample Web API project, that caters simple CRUD operations on the database, using the Entity Framework. We’ll not go into the details of underlying project architecture and the standard way of architecture of the same, but will focus on the content negotiation part in Web API projects. For creating a standard enterprise level Application with Web API, you can follow this series. You can find all the downloads related to this article at the end of the post.

Continue reading “Formatters And Content Negotiation In ASP.NET Web API 2”