title: laravel ajax request params yields null
body: <p>I am new to laravel framework and started following the laravel tasks tutorial.
  I am trying to pass via ajax request the name of the task in order to save it in the database.</p>
  
  <p><strong>front end:</strong></p>
  
  <pre><code>var taskdata= {
      "name": $("#new_task").val()
  };
  
  //console.log(JSON.stringify(taskdata));
  
  $.ajax({
      url: '/task',
      type: 'POST',
      data: taskdata,
      contentType: 'json',
      processData: false,
      success: function(result) {
          alert("success");
      }
  });
  </code></pre>
  
  <p><strong>server side:</strong></p>
  
  <pre><code>Route::post('/task', function (Request $request) {
  
      //die(var_dump($request-&gt;json("name")));
  
      $validator = Validator::make(json_decode($request-&gt;getContent(), true), [
          'name' =&gt; 'required|max:255',
      ]);
  
      if ($validator-&gt;fails()) {
          return redirect('/')
              -&gt;withInput()
              -&gt;withErrors($validator);
      }
  
      $task = new \App\Task;
      $task-&gt;name = $request-&gt;name;
      $task-&gt;save();
  
      return redirect('/');
  });
  </code></pre>