Added support for GET when requesting request tokens

This commit is contained in:
Raoul Millais
2011-08-16 13:26:49 +01:00
parent a2ac03bc37
commit 1b4624cacd
2 changed files with 19 additions and 1 deletions

View File

@ -460,16 +460,21 @@ exports.OAuth.prototype.post= function(url, oauth_token, oauth_token_secret, pos
}
exports.OAuth.prototype.getOAuthRequestToken= function(extraParams, callback) {
var httpMethod;
if( typeof extraParams == "function" ){
callback = extraParams;
extraParams = {};
}
if( typeof callback == "string"){
httpMethod = callback;
}
// Callbacks are 1.0A related
if( this._authorize_callback ) {
extraParams["oauth_callback"]= this._authorize_callback;
}
this._performSecureRequest( null, null, "POST", this._requestUrl, extraParams, null, null, function(error, data, response) {
this._performSecureRequest( null, null, httpMethod || "POST", this._requestUrl, extraParams, null, null, function(error, data, response) {
if( error ) callback(error);
else {
var results= querystring.parse(data);