def call(self, route, parameters, mimetype="application/ld+json", defaults=None):
        """ Call an endpoint given the parameters

        :param route: Named of the route which is called
        :type route: str
        :param parameters: Dictionary of parameters
        :type parameters: dict
        :param mimetype: Mimetype to require
        :type mimetype: str
        :rtype: text
        """
        if not defaults:
            defaults = {}
        parameters = {
            key: str(parameters[key])
            for key in parameters
            if parameters[key] is not None and
               parameters[key] != defaults.get(key, None)
        }
        parameters.update(self.routes[route].query_dict)

        request = requests.get(
            self.routes[route].path,
            params=parameters,
            headers={
                "Accept": mimetype,
                "Accept-Charset": "utf-8",
                "User-Agent": "MyCapytain/{MyCapVersion} {DefaultRequestUA}".format(
                    MyCapVersion=__version__,
                    DefaultRequestUA=requests.utils.default_user_agent()
                )
            }
        )
        request.raise_for_status()
        if request.encoding is None:
            request.encoding = "utf-8"
        return request
def call ( self , route , parameters , mimetype = "application/ld+json" , defaults = None ) : if not defaults : defaults = { } parameters = { key : str ( parameters [ key ] ) for key in parameters if parameters [ key ] is not None and parameters [ key ] != defaults . get ( key , None ) } parameters . update ( self . routes [ route ] . query_dict ) request = requests . get ( self . routes [ route ] . path , params = parameters , headers = { "Accept" : mimetype , "Accept-Charset" : "utf-8" , "User-Agent" : "MyCapytain/{MyCapVersion} {DefaultRequestUA}" . format ( MyCapVersion = __version__ , DefaultRequestUA = requests . utils . default_user_agent ( ) ) } ) request . raise_for_status ( ) if request . encoding is None : request . encoding = "utf-8" return request
Call an endpoint given the parameters

        :param route: Named of the route which is called
        :type route: str
        :param parameters: Dictionary of parameters
        :type parameters: dict
        :param mimetype: Mimetype to require
        :type mimetype: str
        :rtype: text