Monday 11 April 2016

Can't seem to POST an add comment request (using 'request')

Hello, trying to send a POST request that adds a comment to an Instagram photo. I have all my cookies set up correctly so I'm logged into Instagram. For some reason it doesn't work at all. Here's my code:var request = require('request'); var j = request.jar(); request = request.defaults({jar:j}); j.setCookie(request.cookie('ds_user_id=REDACTED;sessionid=REDACTED'), 'http://ift.tt/1kwsCwF'); request.post({ url: 'http://ift.tt/1RQnIKV', form: {comment_text: 'This work, taken as a whole, lacks serious literary, artistic, political, or scientific value.'}, }, function(error, response, body) { console.log(body); }); Here's what it looks like in Chrome Developer Tools when I add a commentThe code runs fine without any errors but gives an error page instead of the JSON I expected (also it doesn't post a comment)

Submitted April 12, 2016 at 04:28AM by omgflyingbanana

No comments:

Post a Comment