My action method:
[Authorize]
[HttpGet]
[Produces("text/xml")]
public async Task<GetJobsForThirdPartyResponse> GetJobs(GetJobsForThirdPartyQuery query)
{
var response = await this.Bus.Query(query);
return response.Data;
}
My partial Startup
class:
services.AddMvc(options =>
{
options.OutputFormatters.Add(new XmlSerializerOutputFormatter());
});
Postman request is like bellow:
I've also tried [Produces("application/xml")]
with Accept: application/xml
header request. But no luck.