Code

restlib

This package is a simple implementation of a REST client library.

class restlib.REST(server, port=80, user=None, password=None)

REST connection class.

delete(location, params=None)

Delete a resource from the server.

Location is the relative location on the server to use.

A RESTUnexpectedCode will be raised if an unexpected response comes back from the server.

get(location, params=None)

Get a resource from the server.

Location is the relative location on the server to use.

A RESTUnexpectedCode will be raised if an unexpected response comes back from the server.

post(location, params=None)

Post (modify) a resource on the server.

Location is the relative location on the server to use.

A RESTUnexpectedCode will be raised if an unexpected response comes back from the server.

put(location, params=None)

Put a (new) resource on the server.

Location is the relative location on the server to use.

A RESTUnexpectedCode will be raised if an unexpected response comes back from the server.

restlib.json

Classes for JSON to object.

@warning: This module is still in heavy flux.

class restlib.json.JSON(json_data)
JSON representation of struct data.

restlib.logger

Logger setup

restlib.logger.get_restlib_logger(level='warning', name='root')

Shortcut to get a logging object.

Level is a string representing the lowest level to log.

restlib.restexceptions

Specific exceptions related to the REST library.

exception restlib.restexceptions.RESTException

A generic REST exception.

args
message
exception message
exception restlib.restexceptions.RESTUnexpectedCode

Exception when an unexpected code comes back from a request.

args
message
exception message

Table Of Contents

Previous topic

Development

Next topic

Tests

This Page

Quick search