Start a new topic

Making simple POST request with authorization header

Hi there, I'm having issues trying to do a pretty simple POST request:



modules.request.post({

uri: 'https://api.twitter.com/1.1/statuses/update.json?status=' + encodeURIComponent(message),

headers: {

Authorization: 'OAuth oauth_consumer_key="xxx", oauth_nonce="yyy", oauth_signature="zzz", oauth_signature_method="HMAC-SHA1", oauth_timestamp="000", oauth_token="aaa", oauth_version="1.0"'

},

json: true,

}, function (err, res, user) {

});



I'm trying to do a simple hardcoded call to the twitter API to create a tweet, but whenever I try this, it gives me the error "Could not authenticate you, code 32". I got the authorization header direction from the OAuth tool on the Twitter app developer dashboard. What am I doing wrong here?
1 Comment

Not sure, it's a twitter error, have you looked at their forums, e.g. https://dev.twitter.com/discussions/11494? The code looks right on our side.
Login or Signup to post a comment