cURL → Python

Convert a cURL command into a Python requests snippet.

Runs entirely in your browser

FAQ

Does it use requests or urllib?
requests. It's not in the standard library but it's the de-facto standard for HTTP in Python. Install with `pip install requests`.
Why does JSON come out as json=payload?
requests handles Content-Type and body serialization for you when you pass json=; you get correct escaping and Content-Length automatically.

Related tools