How can I have my vnext API to return XML and JSON ?
I thought that using content-type with application/xml would work as it was before. Note that I tryed with Accep
Updated details following release of .Net Core 1.0.0
startup.cs
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc(config =>
{
// Add XML Content Negotiation
config.RespectBrowserAcceptHeader = true;
config.InputFormatters.Add(new XmlSerializerInputFormatter());
config.OutputFormatters.Add(new XmlSerializerOutputFormatter());
});
project.json
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.0.0",
For more help see Shawn Wildermuths blog post on the subject: Content Negotiation in ASP.NET Core