title: MVC4 REST API always returns response in JSON format
body: <p>I used MVC4 Rest APi for my latest project. But I ran into one issue which I'm unable to figure out.</p>
  
  <p>My request supports both JSON and XML format and I have no problem in getting a response from my request. </p>
  
  <p>While testing I found out issue that while hitting this API using <a href="https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US" rel="nofollow">"Advanced Rest Client"</a>, even if I send request in JSON format, the response is always in XML format.</p>
  
  <p>But if I use Fiddler, it works fine i.e JSON request gives JSON response and XML request gives XML response</p>
  
  <pre><code>Request headers 
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36
  Origin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo
  Content-Type: application/xml 
  Accept: */*
  Accept-Encoding: gzip,deflate,sdch
  Accept-Language: en-US,en;q=0.8
  
  
  Response headers 
  Cache-Control: no-cache 
  Pragma: no-cache 
  Content-Type: application/json; charset=utf-8 
  Expires: -1 
  Server: Microsoft-IIS/8.0 
  Date: Mon, 21 Jul 2014 12:01:27 GMT 
  Content-Length: 340 
  </code></pre>
  
  <p>I'm afraid the end users might face the same issue. So is there any way to fix this?</p>
  
  <p>All I can find is to forcefully use only one format for my Web API to solve this. But I have to support both formats. </p>
  
  <p>Is there a way to this?</p>
  
  <p>Thanks</p>