Skip to content

Instantly share code, notes, and snippets.

@justinrainbow
Created April 13, 2012 17:11
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 justinrainbow/2378423 to your computer and use it in GitHub Desktop.
Save justinrainbow/2378423 to your computer and use it in GitHub Desktop.
YUI().use('connect-api', function (Y) {
var connect = Y.Connect.getInstance();
connect.set('baseUrl', 'http://jrainbow.dev.connect.sheknows.com');
connect.set('commands.favorites', {
url: '/me/favorites.json',
method: 'GET',
// cors: false, // disabled the CORS / Ajax requests
credentials: true, // needed for accessing User data
cache: true
});
connect.request('favorites', function (res) {
});
// alternatively, you can make requests without creating a command.
// NOTE: You will not be able to access user data this way.
connect.request('GET', '/favorites', {}, function (res) {
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment