Skip to content

Instantly share code, notes, and snippets.

@fangel
Created March 20, 2010 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fangel/338583 to your computer and use it in GitHub Desktop.
Save fangel/338583 to your computer and use it in GitHub Desktop.
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