.ajax call "fails" on a 201 created but succeeds "done" if async==false
<p>Using Jquery 1.9.1 I am running an $.ajax call that succeeds only if I set "async" to false.  I've looked at request/response and they are good.  No reason to be calling "fail" that I can see.</p>

<p>I am expecting .done() to be called even when 'async' is set to true...  I have an integration test that is passing because it sets async to false.  That's literally the only difference.  I confirmed it is the problem because I forced async to false in the real code and it suddenly started succeeding and calling .done().</p>

<p>I'm guessing it's a json parse error or a jQuery bug, but how can I confirm?  I'm having difficulty finding it in the jquery source...  Here's the jQuery code to reproduce.  The server is creating the object correctly and everything looks good.  (as can be seen by the response)</p>

<pre><code>        var newObj = { Name: 'jesus', Birthday: '02/12/2013' };
        return $.ajax(
        {
            url: '/api/method',
            type: 'POST',
            processData: false,
            contentType: 'application/json; charset=utf-8',
            data: JSON.stringify(newObj),
            dataType: 'json',
            async: true,
        })
        .done(function (data, statusText) {
            console.log(statusText);
        })
        .fail(function(jqXHR, textStatus, errorThrown) {
            console.error(jqXHR);
            console.error(textStatus);
            console.error(errorThrown);
        });


POST http://localhost:64838/api/method HTTP/1.1
Host: localhost:64838
Connection: keep-alive
Content-Length: 48
Accept: application/json, text/javascript, */*; q=0.01
Origin: http://localhost:64838
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko)        Chrome/24.0.1312.57 Safari/537.17
Content-Type: application/json; charset=UTF-8
Referer: http://localhost:64838/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

 {"Name":"jesus","Birthday":"02/17/2013"}


HTTP/1.1 201 Created
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Location: http://localhost:64838/api/method/23
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Origin: *
Date: Sun, 24 Feb 2013 05:07:27 GMT
Content-Length: 115

{"Id":23,"UserId":1,"Name":"jesus","someDate":"2013-02-17T00:00:00","someId":null,"someOtherProperty":null}
</code></pre>

<p>P.S. it was extremely annoying making 4 spaces before each line in the above output.  Is there an easier way to format code blocks in SO?  </p>

<p>Thanks for any help.</p>

<p>EDIT: please don't read too deeply into the request/response I've posted.  I tampered with the names of things before posting it to the public on SO.  Therefore content-length is wrong, and maybe some other stuff...  </p>
