CURL alternative in Python

Gaurav Sharma picture Gaurav Sharma · Apr 19, 2010 · Viewed 229.8k times · Source

I have a cURL call that I use in PHP:

curl -i -H 'Accept: application/xml' -u login:key "https://app.streamsend.com/emails"

I need a way to do the same thing in Python. Is there an alternative to cURL in Python. I know of urllib but I'm a Python noob and have no idea how to use it.

Answer

Gudbergur picture Gudbergur · Apr 10, 2012

You can use HTTP Requests that are described in the Requests: HTTP for Humans user guide.