Having trouble with py requests post? Need help sending data correctly! or How to properly use py req

16 Replies, 924 Views

Hey! Your issue might be with the server’s CORS policy. Try adding `'Origin': 'yourdomain.com'` to your headers. Also, some APIs need a `User-Agent`.

For py requests post, I always test with a minimal payload first. If it works, I build up from there.

---

Thanks everyone for the tips! I tried switching to `json=` and it worked like a charm. Still getting a 400 error though, so I’ll test with Postman and check the logging trick.

Also, didn’t know about `ensure_ascii=False`—gonna try that next. You all rock!

Messages In This Thread



Users browsing this thread: 1 Guest(s)