title: Set custom Content-Type in Joomla Framework
body: <p>I am using the Joomla framework API to build a web application.
  Now I want to display some data from the database in JSON format and I have to change the default HTTP-Content-Type from <strong>text/html</strong> to <strong>application/json</strong>.
  The Joomla framework comes with the Symfony HTTP foundation component, so I've searched the web and found this:</p>
  
  <pre><code>use Symfony\Component\HttpFoundation\Response;
  $response = new Response();
  $response-&gt;headers-&gt;set('Content-Type', 'application/json');
  $response-&gt;send();
  </code></pre>
  
  <p>But there is no effect. </p>
  
  <p>I have also tried the standard way:</p>
  
  <pre><code>header("Content-Type: application/json");
  </code></pre>
  
  <p>That doesn't work too..</p>
  
  <p>Thanks for any advice!</p>