Friday, January 24, 2014

Requests.py

I needed to do some RESTful calls via command line.
Naturally, I could have used curl, but I wanted to save my commands.

I remember I used Python a long time ago, so I was investigating curling via Python. There is a pycurl library, but this one seemed simple and fun.

To set up,

Get the Code

Requests is actively developed on GitHub, where the code is always available.
You can either clone the public repository:
git clone git://github.com/kennethreitz/requests.git
Download the tarball:
$ curl -OL https://github.com/kennethreitz/requests/tarball/master
Or, download the zipball:
$ curl -OL https://github.com/kennethreitz/requests/zipball/master
Once you have a copy of the source, you can embed it in your Python package, or install it into your site-packages easily:
$ python setup.py install

Super simple, very fun!
It just works!

No comments:

Post a Comment