def METHOD_NAME(self, endpoint, method="GET", json=None, **params):
    self.get_auth_session_token()
    try:
        response = self.default_session.request(method, self.API_URL + endpoint, json=json, params=params)
        response.raise_for_status()
    except RequestException as e:
        error_code = status_code = None
        if e.response is not None:
            status_code = e.response.status_code
            if status_code in [401, 403]:
                # ask for a new session token and try again
                self.get_auth_session_token(renew=True)
                return self.METHOD_NAME(endpoint, method, json, **params)
            if status_code == 400:
                error_code = e.response.text.strip()
        raise DEPClientError("Could not perform operation",
                             error_code=error_code, status_code=status_code)
    else:
        self.auth_session_token = response.headers.get(self.TOKEN_HEADER)
        try:
            return response.json()
        except ValueError:
            return response.content