Why is my API returning 504 Responses through the requests module but working fine (200) on Postman?

77 views Asked by At

I am attempting to make a requests.requests("Post") request to an API in my python script. If I test my API endpoint in Postman and make the POST request, I am able to get the correct response w/ a <Response 200> no problem. But if I use the exact same code postman uses in my python script or in a Jupyter notebook, I'm receiving a <504 Response>.

I've tried requests.Post. I've tried requests.request("POST"). I've tried with and without certify.

This is for an enterprise application if that changes anything.

Not really sure what I should do here. Just a poor intern lost in the weeds.

1

There are 1 answers

0
Ed Ke On

It could happen that in Postman, multiple headers are sent along, and you would need to incorporate them in Python.