title: aJax REST API call - Curl Works while aJax fails
body: <p>I'm using a cURL api call and I've converted it to ajax but it doesn't work. Any ideas?</p>
  
  <pre><code>curl -v -X POST -H "Content-Type: application/json" -H "Accept: application/json" --user user:pass https://i.am.web/123456789/events -d "{\"name\": \"Marcus0.1\",\"start\": 500000,\"end\": 1361640526000}"
  </code></pre>
  
  <p>.</p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: 'https://i.am.web/123456789/events',
      dataType: 'application/json',
      accept: 'application/json',
      async: false,
      username: 'user',
      password: 'pass',
      data: {
          "name": "Marcus0.3",
          "start": 500000,
          "end": 1361640526000
      },
      success: function(){alert('DONE!');},
      error:function(error){alert(error)},
  });
  alert("ENDING API MAIN FUNCTION")
  </code></pre>
  
  <p>Chrome errors:</p>
  
  <p><a href="http://i.am.website/123456789" rel="nofollow">http://i.am.website/123456789</a>  &amp;  POST &amp; 401 unauthorized &amp; text/html  &amp; query.min/js:2 Script</p>