title: How to tell ZF2's JsonModel to return text/plain instead of application/json?
body: <p>Using PHP Zend Framework 2.0.2, I return JSON data after an AJAX call. Obviously, Internet Explorer 9 wants to download the data instead of returning it to the calling Javascript method.</p>
  
  <p>Posts like <a href="https://stackoverflow.com/questions/2483771/how-can-i-convince-ie-to-simply-display-application-json-rather-than-offer-to-do">this one</a> and <a href="https://stackoverflow.com/questions/11266183/ie-wants-to-download-json-result-mvc3">this one</a> say to use <code>Content-Type: text/plain</code> instead of <code>Content-Type: application/json</code>, but how do I do this with ZF2's JsonModel? I'm new to it...</p>
  
  <p>I imagine I have to set something in the <code>setOptions()</code> array, but what?</p>
  
  <pre><code>public function testJsonAction()
  {
     $jsonResponse = new JsonModel(array('success' =&gt; false));
  
     $jsonResponse-&gt;setOptions(array(
           // ** Should I put something here? What? **
     ));
  
     return $jsonResponse;
  }
  </code></pre>
  
  <p>I tried using these:</p>
  
  <pre><code>  $this-&gt;getResponse()-&gt;getHeaders()-&gt;addHeaderLine('Content-Type', 'text/plain');
    $this-&gt;getResponse()-&gt;getHeaders()-&gt;addHeaderLine('Content-Disposition', 'inline; filename="textdata.json"');
  </code></pre>
  
  <p>but it doesn't change the HTTP Content-Type in the response headers:</p>
  
  <pre><code>Key                   Value
  Response              HTTP/1.1 200 OK
  Content-Type          application/json
  Server                Microsoft-IIS/7.5
  X-Powered-By          PHP/5.3.13
  Set-Cookie            ZDEDebuggerPresent=php,phtml,php3; path=/
  Content-Disposition   inline; filename="textdata.json"
  X-Powered-By          ASP.NET
  Date                  Wed, 10 Oct 2012 13:19:42 GMT
  Content-Length        17
  </code></pre>
  
  <p>Thanks for your help!</p>