Today python-requests is the de-facto standard library for rest calls.
As everything goes on TLS, you can trace api calls with the following:
import httplib as http_client
http_client.HTTPConnection.debuglevel = 1
requests_log = logging.getLogger("requests.packages.urllib3")
requests_log.propagate = True
After all that hype about cloud and Amazon services, I decided to set up a simple S3 server on my laptop. On google code I found little-s3, a funny webapp which implements the s3 protocol and I check it out.
The guide is straightforward and the protocol implemented is mainly a GET/PUT server: a free place for testing your “cloud” infrastructure.
Here are some example methods:
1- create the object foo.html.
curl –data “@foo.html” –request PUT –header “Content-Type: text/html” “http://localhost:8080/littleS3-2.1.0/firstBucket/foo.html”
2- Retrieve an object
3- Delete an object
curl –request DELETE “http://localhost:8080/littleS3-2.1.0/firstBucket/foo.html”
4- Delete a bucket
curl –request DELETE “http://localhost:8080/littleS3-2.1.0/firstBucket”