title: Slim's withJson doesn't properly set Response Content-Type header
body: <p>I am trying to send a JSON with :</p>
  
  <pre><code>return $response-&gt;withJson ($full_config, 200) ;
  </code></pre>
  
  <p>Problem : it doesn't set the <code>Content-Type</code> to <code>applciation/json</code> :</p>
  
  <ul>
  <li>It sends and response with <code>Content-Type</code> to <code>text/html; charset=UTF-8</code></li>
  <li><p>The <strong>body</strong> contains : </p>
  
  <pre><code>HTTP/1.1 200 OK
  Content-Type: application/json
  
  here_be_my_wanted_json_content
  </code></pre></li>
  </ul>
  
  <p>NB1 : This post seems to be a duplicate of <a href="https://stackoverflow.com/q/45139245/7031981">Slim request header is setting text/html, even i am using withJson.</a>, but it's been 2 years without answers, and I'm trying to add more information.</p>
  
  <p>NB2 : This doesn't fix anything :</p>
  
  <pre><code>return $response
      -&gt;withJson ($full_config, 200)
      -&gt;withHeader ('Content-Type', 'application/json') ;
  </code></pre>
  
  <p>NB3 : This fixes the problem :</p>
  
  <pre><code>return json_encode ($full_config) ;
  </code></pre>
  
  <p>But :</p>
  
  <ul>
  <li>This is annoying since I can't add statuses or additional headers.</li>
  <li>This isn't very "the Slim way to do it".</li>
  </ul>
  
  <p>NB4 : I am using Slim version 3.12.1</p>
  
  <p>NB5 : I am retrieving the response in a javascript (jQuery) with</p>
  
  <pre><code>$.get(url, function (data, status) {
      if (status === 'success')
          console.log (data)
  });
  </code></pre>