What's the best way to use curl in Python for web requests? or How do I replace curl commands with Py

16 Replies, 1077 Views

man, just use `requests`.

curl in python is only worth it if you’re doing something super specific (like custom auth flows libcurl handles).

Otherwise, you’re adding complexity for no reason. `requests` even has a `Session` object for keeping headers/cookies.

---

Thanks for all the replies!

Tried `httpx` based on the suggestions and it’s way cleaner than fighting with curl python.

Still gotta check out `curlconverter.com`—sounds like a time-saver.

One follow-up: anyone know if `httpx` handles chunked uploads as easily as curl? That’s my next hurdle.

Messages In This Thread



Users browsing this thread: 1 Guest(s)