title: Statuscode 406 (Not Acceptable) in ASP.NET Core
body: <p>REST services should provide content negotiation. This means that clients send an Accept header that contains the desired content type of the response. If the service does not support this media type, it should respond with status code 406 (Not Acceptable).</p>
  
  <p>I try to map this behavior to ASP.NET Core. ASP.NET core returns a JSON document, if it doesn't recognize the media type in the Accept header. In previous versions of the framework the behavior described above could be achieved by adding a special output formatter to the configuration:</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services) {
    services.AddMvc(options =&gt; {
      options.OutputFormatters.Insert(0, new HttpNotAcceptableOutputFormatter());
    });
  }
  </code></pre>
  
  <p>Unfortunately, <code>HttpNotAcceptableOutputFormatter</code> was removed from the ASP.NET Core framework after RC1. Is there any replacement for this class in the current version of the framework?</p>