A
A
antofa2016-04-25 19:18:03
Python
antofa, 2016-04-25 19:18:03

Problem with Instagram authorization?

Good afternoon. The situation is this: there is a working Python script for working with the Instagram API. Today it was necessary to reproduce an HTTPS POST request in some emulator (Httprequester in Firefox, for example), so when the body and headers match, for some reason, a 400 Bad request error is returned.
IMG_25042016_190944.png
And if you catch this request using Charles / Fiddler and repeat it there, then the correct response of this form is returned:

{"logged_in_user":{"username":"USERNAME","has_anonymous_profile_picture":false,"profile_pic_url":","full_name":"Ivan Ivanov","pk":123456789,"is_private":false},"status ":"ok"}

How to solve this problem? There are no ideas at all.
Code and raw request from Charles is attached.
https://gist.github.com/antofa/b2c2922c941ceb7aa96...
https://gist.github.com/antofa/5601e6be2af44267b33...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
antofa, 2016-04-27
@antofa

I found the solution to the problem by accident. In the browser plugin, I left only 1 User-Agent header (he set the rest himself) and the request passed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question