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

Python requests POST command is not following 302 redirect

$
0
0

When passing a POST request to a website via requests, it is failing to complete and will wait indefinitely.

I have reviewed the behaviour in Fiddler and I can see that the POST request is returning successfully with a 302 redirect. However, Requests continues to wait and will never continue although the packets have returned.

I'm stuck on how to diagnose this as I get no solid error and the packets appear to return, any help will be much appreciated.

The post request is built as follows:

loginData = 'data=45B892A0F9C127FB0A052CB&cid=1000's.post(url, verify=rVerify, headers=headers, data=loginData)

I have tried allow_redirects as both True and False with no success.

Here is the request and response in Fiddler:

fiddler result

Update header details:

'User-Agent': 'Mozilla/5.0''Content-Type': 'application/x-www-form-urlencoded''Connection': 'Keep-Alive''Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8''Accept-Language': 'en-US,en;q=0.5''Accept-Encoding': 'gzip, deflate, br'

Update:

  • I have tested just using the URL and the command will still hang.
  • I have also attempted a GET request and this also hangs.

Viewing all articles
Browse latest Browse all 1557

Trending Articles