def __get_response(self, uri, params=None, method="get", stream=False):
        if not hasattr(self, "session") or not self.session:
            self.session = requests.Session()
            if self.access_token:
                self.session.headers.update(
                    {'Authorization': 'Bearer {}'.format(self.access_token)}
                )

        # Remove empty params
        if params:
            params = {k: v for k, v in params.items() if v is not None}

        kwargs = {
            "url": uri,
            "verify": True,
            "stream": stream
        }

        kwargs["params" if method == "get" else "data"] = params

        return getattr(self.session, method)(**kwargs)
Creates a response object with the given params and option
dataset/ETHPy150Open toloco/pyoanda/pyoanda/client.py/Client.__get_response