Created
March 20, 2010 09:55
-
-
Save fangel/338583 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var accessor = { | |
consumerKey: 'your consumer token key, | |
consumerSecret: 'your consumer token secret', | |
token: 'your access/request token key', | |
tokenSecret: 'your access/request token secret' | |
}; | |
var message = { | |
action: 'http://yoururl.com/endpoint', | |
method: 'GET', | |
parameters: [] | |
}; | |
OAuth.completeRequest(message, accessor); | |
jQuery.ajaxSetup({ | |
'beforeSend': function(xhr) { | |
xhr.setRequestHeader("Authorization", ah) | |
}, | |
'error': function(req, err) { | |
// whatever onError | |
} | |
}); | |
jQuery.get( message.action, [], function(data, textStatus) { | |
// whatever onComplete | |
}, 'text'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment