diff --git a/pyiceberg/catalog/rest.py b/pyiceberg/catalog/rest.py index c824e69133..53b93565c7 100644 --- a/pyiceberg/catalog/rest.py +++ b/pyiceberg/catalog/rest.py @@ -292,8 +292,9 @@ def _fetch_access_token(self, session: Session, credential: str) -> str: else: client_id, client_secret = None, credential data = {GRANT_TYPE: CLIENT_CREDENTIALS, CLIENT_ID: client_id, CLIENT_SECRET: client_secret, SCOPE: CATALOG_SCOPE} - # Uses application/x-www-form-urlencoded by default - response = session.post(url=self.auth_url, data=data) + response = session.post( + url=self.auth_url, data=data, headers={**session.headers, "Content-type": "application/x-www-form-urlencoded"} + ) try: response.raise_for_status() except HTTPError as exc: