title: How can I use JQuery to post JSON data?
body: <p>I would like to post Json to a web service on the same server. But I don't know how to post Json using JQuery. I have tried with this code:</p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: '/form/',
      data: {"name":"jonas"},
      success: function(data) { alert('data: ' + data); },
      contentType: "application/json",
      dataType: 'json'
  });
  </code></pre>
  
  <p>But using this JQuery code the data is not received as Json on the server. This is the expected data at the server: <code>{"name":"jonas"}</code> but using JQuery the server receive <code>name=jonas</code>. Or in other words, it's "urlencoded" data and not Json.</p>
  
  <p>Is there any way to post the data in Json format instead of urlencoded data using JQuery? Or do I have to use a manual ajax request?</p>