I have the following simple Web API controller:
// GET: api/customers
[HttpGet]
public async Task Get()
{
var
For Core 2.x versions, you have to do two things. First thing is you need to add following code inside the ConfigureServices method of Startup.cs file.
services.AddMvc()
.AddMvcOptions(o => o.OutputFormatters.Add(
new XmlDataContractSerializerOutputFormatter())
);
And then add the Accept "application/xml" header to the request as below on Postman. Then XML formatted result will be returned.