amoshg/backbone-oauth-1.0a — pull request #2 by mhan (2013-09-03 23:50:39+00:00)
Title: Return the jqXHR object for every request.

It is a convention in Backbone to return the jqXHR object whenever any
$.ajax functions are called. Because the jQuery abstraction for the XHR
object allows chaining, it makes sense to return it here.

This is particularly useful if you wanted to use jQuery's Promises implementation:

var oauth = new Backbone.OAuth();
var promise = oauth.apiRequest('http://some.sweet.service/book/1', 'secret', 'access', {});
promise.then(function(book) {
return oauth.apiRequest(book.authorsURL, 'secret', 'access');
}).then(function(authors) {
// Process authors info
});