Default Requestor

class moco_wrapper.util.requestor.DefaultRequestor(delay_ms=1000.0)

Default Requestor class that is used by the moco_wrapper.Moco instance.

When the default requests requests a ressources and it sees the error code 429 (too many requests), it waits a bit and then tries the request again. If you do not want that behaviour, use moco_wrapper.util.requestor.NoRetryRequestor.

request(method, path, params=None, data=None, delay_ms=0, **kwargs)

Request the given ressource

Parameters:
  • method – HTTP Method (eg. POST, GET, PUT, DELETE)
  • path – Path of the ressource (e.g. /projects)
  • params – Url parameters (e.g. page=1, query parameters)
  • data – Dictionary with data (http body)
  • delay_ms – Delay in milliseconds the requestor should wait before sending the request (used for retrying, default 0)
  • kwargs – Additional http arguments.
Returns:

Response object

session

Http Session this requestor uses