title: Sending JSON content type + JavaScript objects ( jQuery ajax )
body: <p>I am having trouble sending a JavaScript objects over a http request. The http endpoing  only accepts json content-type ("application/json" or "text/json")</p>
  
  <p>I am not sure why 
  data2 ( stringified json ) works fine 
  But, data1 ( json object ) throws http 400 Bad Request.
   i.e why is jQuery not serializing the json object to a valid json string for the server to process.</p>
  
  <pre><code>var data1 = ({ rating : 3 });  //does not work
  var data2 = '{ "rating" : 3}'; //works fine
  
  $.ajax({
      url : "/rate",
      data : data1,
      type : "POST",
      contentType: "application/json",
      success: function(json){
          console.log("Ajax Return :"+json);
      }
  });
  </code></pre>