title: laravel 4 why send content-type when sending json?
body: <p>In the book of laravel I read, and also my co-worker who has experience with laravel said that generating JSON I should in laravel way.</p>
  
  <p>Why do I need to do this:</p>
  
  <pre><code>Route::get('markdown/response', function()
  {
      $data = array('iron', 'man', 'rocks');
      return Response::json($data);
  });
  </code></pre>
  
  <p>As I read it sends also content-type header when using this.</p>
  
  <p>When I was using codeigniter I used to do simply this:</p>
  
  <pre><code>echo json_endode($data);
  </code></pre>
  
  <p>and never ever ever had any problems. Even if it is not set content type. Actually I dont know maybe php sets it automatically, but since I did not have problems, I did not care.</p>
  
  <p>And when using 'new' technology I really want to know why it is better than good old one.</p>