title: Laravel - Ajax error: xhr.send( options.hasContent && options.data || null );
body: <p>When I refresh the document, sometimes is working fine (I get the json object in console), but many times I get 500 (Internal Server Error) and from jQuery I see the error is: xhr.send( options.hasContent &amp;&amp; options.data || null ); Please help me. Here is the code:</p>
  
  <pre><code>$(document).ready(function(){
      $.ajax({
          url: '/ajax/cis',
          method: "GET", 
          success: function(data){
              console.log(data);
          }
      });
  });
  </code></pre>
  
  <p>'/ajax/cis' is a laravel controller wich only returns a json object:</p>
  
  <pre><code>return response()-&gt;json(['cis_names'=&gt;'cis_names']);
  </code></pre>
  
  <p>I also tried with post method:</p>
  
  <pre><code>$.ajax({
      url: '/ajax/cis',
      method: "POST", 
      data:{_token: token},  
      //var token = Session::token()
      success: function(data){
          console.log(data);
      }
  });
  </code></pre>