Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: socket hang up #346

Open
lucypoly opened this issue Mar 29, 2018 · 0 comments
Open

Error: socket hang up #346

lucypoly opened this issue Mar 29, 2018 · 0 comments

Comments

@lucypoly
Copy link

lucypoly commented Mar 29, 2018

Hi! I'am trying to use Twitter api.
const OAuth = require('OAuth');
const oauth = new OAuth.OAuth(
'https://api.twitter.com/oauth/request_token',
'https://api.twitter.com/oauth/access_token',
'...',
'...',
'1.0A',
null,
'HMAC-SHA1'
);

Here is my request:
oauth.post( constants.BASE + 'collections/create.json?name=' + name, constants.TOKEN, constants.SECRET, (e, data, response) => { console.log(JSON.parse(data)); });

But I received
_throw er; // Unhandled 'error' event
Error: socket hang up at createHangUpError (_http_client.js:331:15)

Instead
oauth.get( constants.BASE + 'search/tweets.json?q=' + id + '&count=10', constants.TOKEN, constants.SECRET, (e, data, response) => { console.log(JSON.parse(data)); });
works fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant