title: jsfiddle for ajax POST JSON echo
body: <p>I am trying to do jquery ajax POST of an object as JSON and get it echoed back</p>
  
  <pre><code>var dict = { key1: 'val1', key2: 10 };
  
  $.ajax({
      url: '/echo/json/',
      type: 'POST',
      contentType: 'application/json; charset=utf-8',
      dataType: 'json',
      data: JSON.stringify(dict),
  })
  .done(function(data, textStatus, jqXHR) {
      alert('data='+JSON.stringify(data));
  
  }).fail(function(jqXHR, textStatus, errorThrown) {
      alert('error');
  });
  </code></pre>
  
  <p>see <a href="https://jsfiddle.net/6d688qah/1/" rel="nofollow">jsfiddle</a></p>
  
  <p>But no luck - I'm getting an empty {}</p>
  
  <p>What am I doing wrong ?</p>