title: Xml Requests do not work
body: <p>I cannot get a bare bones Asp.Net Core Web Api project to work using Xml instead of Json. Please help!</p>
  
  <p>I have created a new project and the only adjustments to the default configuration were to add the Xml formatters...</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      // Add framework services.
      services.AddApplicationInsightsTelemetry(Configuration);
  
      services.AddMvc(config =&gt;
      {
          config.InputFormatters.Add(new XmlSerializerInputFormatter());
          config.OutputFormatters.Add(new XmlSerializerOutputFormatter());
      });
  }
  </code></pre>
  
  <p>My Controller also contains simple Get and Post methods:</p>
  
  <pre><code>[Route("api")]
  public class MessageController : Controller
  {
      [HttpPost]
      public void Post([FromBody] Message message)
      {
  
      }
  
      [HttpGet]
      public IActionResult Get()
      {
          return Ok(new Message
          {
              TestProperty = "Test value"
          });
      }
  }
  </code></pre>
  
  <p>When I try calling the <code>POST</code> method with <code>Content-Type: application/xml</code>, the API returns 415 Unsupported Media Type. I have tried adding the <code>Consumes("application/xml")</code> attribute to the controller and still it does not work.</p>
  
  <p>The GET works and returns JSON. However, if I add the <code>Produces("application/xml")</code> attribute to the controller, the GET returns 406  Not Acceptable, even if I provide the <code>Accepts: application/xml</code> header.</p>
  
  <p>For some reason, the API is completely rejecting anything related to xml even though the input and output formatters were added as I have seen in the very few examples I could find. </p>
  
  <p>What am I missing?</p>