Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A very simple REST client.
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
restclient
README.md
setup.py

README.md

Simple REST client

This is a very simple class encapsulating a connection to a server and providing the four standard REST methods: get, put, post and delete.

Use

Use it like this:

server = RestClient("www.example.com", "/api/v1/")
resource = server.get("resource")

The following parameters are available:

  • hostname: the first argument, "www.example.com"
  • prefix: a path prefix, "/api/v1/"
  • headers: a dict
  • params: a dict, the parameters making up the query part, "?p=1&t=a"
  • username: basic authentication
  • password: basic authentication
  • secure: boolean, if true use HTTPS
  • raw_response: boolean, if true return the HTTPResponse object from httplib, otherwise return the data read.

License

MIT

Something went wrong with that request. Please try again.