diff --git a/requests_oauthlib/oauth2_session.py b/requests_oauthlib/oauth2_session.py index c9566a2..d5d8e5e 100644 --- a/requests_oauthlib/oauth2_session.py +++ b/requests_oauthlib/oauth2_session.py @@ -529,14 +529,14 @@ def request( token = self.refresh_token( self.auto_refresh_url, auth=auth, **kwargs ) + url, headers, data = self._client.add_token( + url, http_method=method, body=data, headers=headers + ) if self.token_updater: log.debug( "Updating token to %s using %s.", token, self.token_updater ) self.token_updater(token) - url, headers, data = self._client.add_token( - url, http_method=method, body=data, headers=headers - ) else: raise TokenUpdated(token) else: