Mid ASP.NET Core

Content negotiation (JSON, XML)?

ASP.NET Core selects the response format based on the Accept header.

  • JSON is the default.
  • To add XML:

services.AddControllers()

.AddXmlSerializerFormatters();

Accept: application/xml

More from ASP.NET Core Tutorial

All questions for this course