Re-ordered the arguments on the getresource thingy.
This commit is contained in:
parent
6113ed72af
commit
313f65ed0d
@ -23,7 +23,7 @@ oa.getOAuthRequestToken(function(error, oauth_token, oauth_token_secret, authori
|
|||||||
sys.puts('accesstoken results :' + sys.inspect(results2))
|
sys.puts('accesstoken results :' + sys.inspect(results2))
|
||||||
sys.puts("Requesting access token")
|
sys.puts("Requesting access token")
|
||||||
var data= "";
|
var data= "";
|
||||||
oa.getProtectedResource(oauth_access_token, oauth_access_token_secret, "http://term.ie/oauth/example/echo_api.php?foo=bar&too=roo", function (response) {
|
oa.getProtectedResource("http://term.ie/oauth/example/echo_api.php?foo=bar&too=roo", "GET", oauth_access_token, oauth_access_token_secret, function (response) {
|
||||||
response.setEncoding('utf8');
|
response.setEncoding('utf8');
|
||||||
response.addListener('data', function (chunk) {
|
response.addListener('data', function (chunk) {
|
||||||
data+=chunk;
|
data+=chunk;
|
||||||
|
@ -174,7 +174,7 @@ exports.OAuth.prototype.getOauthAccessToken= function(oauth_token, oauth_token_s
|
|||||||
request.end();
|
request.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.OAuth.prototype.getProtectedResource= function(oauth_token, oauth_token_secret, url, responseListener) {
|
exports.OAuth.prototype.getProtectedResource= function(url, method, oauth_token, oauth_token_secret, responseListener) {
|
||||||
var oauthParameters= {
|
var oauthParameters= {
|
||||||
"oauth_timestamp": this._getTimestamp(),
|
"oauth_timestamp": this._getTimestamp(),
|
||||||
"oauth_nonce": this._getNonce(32),
|
"oauth_nonce": this._getNonce(32),
|
||||||
@ -195,7 +195,6 @@ exports.OAuth.prototype.getProtectedResource= function(oauth_token, oauth_token_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var method= "GET";
|
|
||||||
var sig= this._getSignature( method, url, this._normaliseRequestParams(oauthParameters), oauth_token_secret);
|
var sig= this._getSignature( method, url, this._normaliseRequestParams(oauthParameters), oauth_token_secret);
|
||||||
|
|
||||||
var orderedParameters= this._sortRequestParams( oauthParameters );
|
var orderedParameters= this._sortRequestParams( oauthParameters );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user