Closed mokkabonna closed 9 years ago
jQuery ajaxTransport does not accept datatype json when you return an error, leaving responseText empty.
$.fixture('POST /api/links', function() { if(!data.Text) return [403, "Forbidden", { text: 'The field Title is required.'} , {}]; //etc });
Fixture will modify this and send the following to ajaxTransport
403, 'Forbidden', {json:{text:'The field Title is required. ' }}, {}
While it should be
403, 'Forbidden', {text:'The field Title is required. ' }, {}
That way when you do
myrequest.fail(function(jqXHR){ console.log(jqXHR.responseText ) //Not undefined });
jQuery ajaxTransport does not accept datatype json when you return an error, leaving responseText empty.
Fixture will modify this and send the following to ajaxTransport
403, 'Forbidden', {json:{text:'The field Title is required. ' }}, {}
While it should be
403, 'Forbidden', {text:'The field Title is required. ' }, {}
That way when you do