README.markdown

Dolt

A dumb little wrapper around RESTful interfaces

What is Dolt?

Dolt is a minimalist wrapper around RESTful interfaces, specifically, JSON
RESTful interfaces. Instead of adding another layer on top of the calls, this
uses Httplib2 and some Python magic to allow truly simple wrappers on top of
already well thought out (at least sometimes) REST APIs.

For example, let's look at the Twitter API call for grabbing a user. We'll
use my user, tswicegood

Notice that all you need to add to it is the method you want to call. If
you're feeling very Pythonic and want to be explicit in every call, you can add
.GET as the final method call, though that's always assumed.

Sometimes having that POST or PUT at the end seems weird. You can stick
the method wherever you want in the call string of properties, it just has to
be in all uppercase. For example, this works just the same as the previous
code:

Sending Headers

Dolt can send headers with the request:

api = Dolt()
api.foo.with_headers(Accept='text/html').GET()

Handling authentication

Dolt relies on the httplib2 project for its underlying HTTP
requests. Httplib2 has an add_credentials method that allows you to add
credentials to it. Dolt takes an http parameter in its __init__ method
which allows you to pass in an Http object with credentials. For example: