rattail.tailbone

Tailbone API Client

class rattail.tailbone.TailboneAPIClient(config, base_url=None, max_retries=None, **kwargs)[source]

Simple client for Tailbone web API.

Parameters:
  • base_url

    Base URL of the Tailbone API. Usually this is something like 'http://my.example.com/api' although YMMV.

    If you have a default URL configured as below then you do not need to provide a base_url to this class.

    [tailbone.api]
    base_url = http://my.example.com/api
    

  • max_retries

    Maximum number of retries each connection should attempt. This value is ultimately given to the HTTPAdapter instance.

    Instead of specifying this value via constructor you can add it to your config:

    [tailbone.api]
    max_retries = 5
    

get(api_method, params=None)[source]

Perform a GET request for the given API method, and return the response.

post(api_method, **kwargs)[source]

Perform a POST request for the given API method, and return the response.