Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1491

Post request works through Proxyman but not through Python

$
0
0

I need to send a post request to an API:

  • when sending the request through Proxyman it works fine
  • I tried using the same exact data (double and triple checked) to send a post request and keep getting blocked from the API (status code 401)

Now even more weird: I opened a terminal window through Proxyman, where its able to capture traffic from python libraries. And running the same script there works completely fine.

I have also logged the trafic and the only difference seemed to be that the terminal window through Proxyman sends a connect method first.

The data I am sending contains login details so I am unfortunately not able to include the full request, will add a snippet if that helps.

import requestsdata = {"user": {"password": "mypassword123!", "email": "myemail@email.com"},"scope": "offline"}headers = {"Host": "auth.site.com","Accept-Language": "de-DE,de;q=0.9","X-Site-Locale": "de","X-Site-Device": "2OH3AB9F-2KDA-4203-B1BD-BC7D23598DD9","X-Site-Device-Type": "ios","X-Site-Platform-Version": "iOS 4.71.0 (6575)","User-Agent": "Site - iOS(Release) - de - iPhone9,3 - iOS 15.7.7","Accept": "application/json","Accept-Encoding": "gzip, deflate, br",}response = requests.post(url="https://auth.site.com/v2/users/sessions", headers=headers, json=data)

Please note that I have changed the URL of the API too.

Does anyone know how I could debug my issue? What could be the problem here?


Viewing all articles
Browse latest Browse all 1491

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>