node-oauth
node-oauth copied to clipboard
After request "response.setEncoding is not a function"
Hi. I tried to run basic example and it returns an error response.setEncoding is not a function
. It fails here.
May be it important, i used webpack to build my js.
var OAuth = require('oauth').OAuth;
module.exports = (function () {
var oauthClient = new OAuth(
'https://api.twitter.com/oauth/request_token',
'https://api.twitter.com/oauth/access_token',
'xxx',
'xxx',
'1.0A',
null,
'HMAC-SHA1'
);
oauthClient.get(
'https://api.twitter.com/1.1/trends/place.json?id=23424977',
'xxx', //test user token
'xxx', //test user secret
function (e, data, res){
if (e) console.error(e);
console.log(require('util').inspect(data));
}
);
}());
@Crysp below the fix, there is a PR which hasn't been merged yet, hopefully it will happen asap.
https://github.com/dusnoki/node-oauth/commit/02733180f097c03676cbaafa9df36f93b0f44e1b