How to properly use requests.post in Python for API calls? or Getting errors with requests.post in Py

18 Replies, 810 Views

Ugh, APIs can be such a pain. For debugging, use `curl` or httpie to test the endpoint first. If that works, your requests.post python code might need tweaking.

Also, 500 errors = server-side, so not your fault. But for 400s, check if the API expects URL-encoded form data instead of JSON. Swap `json=data` for `data=data` and see.

Messages In This Thread



Users browsing this thread: 2 Guest(s)