[b]"Having trouble with py requests post? Need help sending data correctly!"[/b] or [b]"How to properly use py req

16 Replies, 781 Views

Been there! The `json=` vs `data=` thing trips everyone up. If you’re sending JSON, `json=` automatically sets the `Content-Type` to `application/json`, so you might not even need the headers.

For debugging, I like to log the whole request with `print(response.request.body)` to see what’s actually being sent.

Messages In This Thread



Users browsing this thread: 1 Guest(s)