phonegap/phonegap-plugins — pull request #595 by julien-c (2012-05-31 16:53:20+00:00)
Title: [iOS/Twitter] Add a more general Twitter API request method

It wouldn't be practical to write a Phonegap helper function for every Twitter API resources, so here's a more general TWRequest encapsulation.

It supports passing a JS array of parameters, and the request method as an option (defaults to GET).

Example:

friendsIds:function(){
TwitterDemo.log("wait..");
window.plugins.twitter.getTWRequest(
'friends/ids.json',
{},
function(s){ TwitterDemo.log("friendsIds success: " + JSON.stringify(s)); },
function(e){ TwitterDemo.log("friendsIds failure: " + e); });
},

usersLookup:function(){
TwitterDemo.log("wait..");
window.plugins.twitter.getTWRequest(
'users/lookup.json',
{user_id: '16141659,783214,6253282'},
function(s){ TwitterDemo.log("usersLookup success: " + JSON.stringify(s)); },
function(e){ TwitterDemo.log("usersLookup failure: " + e); },
{requestMethod: 'POST'});
}