Route

class inori.Route(client, url, trailing_slash=False)

Representation of a single route in an API.

Route objects should be created via Client.add_route().

Example

>>> client = Client('http://foo.bar/v1')
>>> fruits = client.add_route('fruits')
>>> # The following are equivalent statements:
>>> fruits.get()
>>> client.fruits.get()
Parameters:
url

A string resembling a URI.

trailing_slash=False

Add a trailing slash to the Route URI.

headers

Dictionary containing all the Route-level headers

request(http_method, *args, headers=None, **kwargs)

Send an HTTP Request.

Accepts the same keyword arguments as requests.Session.request().

Parameters:
http_method

HTTP method to use for the request

Return type:

Response

post(*args, **kwargs)

Send a POST request.

Return type:

Response

put(*args, **kwargs)

Send a PUT request.

Return type:

Response

get(*args, **kwargs)

Send a GET request.

Return type:

Response

delete(*args, **kwargs)

Send a DELETE request.

Return type:

Response