No-Retry Requestor

class moco_wrapper.util.requestor.NoRetryRequestor

This requestor works along the same lines as the moco_wrapper.util.requestor.DefaultRequestor, but when this requestor comes along the http code 429 for too many requests it just returns an error response.

Use this requestor if you write integration tests or dont have time for retrying the resource.

Example usage:

from moco_wrapper.util.requestor import NoRetryRequestor
from moco_wrapper import Moco

no_retry = NoRetryRequestor()
m = Moco(
    requestor = no_retry
)
request(method, path, params=None, data=None, **kwargs)

Request the given resource

Parameters:
  • method (str) – HTTP Method (eg. POST, GET, PUT, DELETE)
  • path (str) – Path of the resource (e.g. /projects)
  • params (dict) – Url parameters (e.g. page=1, query parameters)
  • data (dict) – Dictionary with data (http body)
  • kwargs – Additional http arguments.
Returns:

Response object

session

Http Session this requestor uses