diff --git a/app/utils/communication/matrix.py b/app/utils/communication/matrix.py index 566689fea8..ca7711ebc6 100644 --- a/app/utils/communication/matrix.py +++ b/app/utils/communication/matrix.py @@ -1,6 +1,6 @@ from typing import Any -import requests +import httpx from app.types.exceptions import MatrixRequestError, MatrixSendMessageError @@ -43,10 +43,15 @@ def post( if "Authorization" not in headers: headers["Authorization"] = "Bearer " + self.access_token - response = requests.post(url, json=json, headers=headers, timeout=10) try: + response = httpx.post( + url, + json=json, + headers=headers, + timeout=10, + ) response.raise_for_status() - except requests.exceptions.HTTPError as err: + except httpx.RequestError as err: raise MatrixRequestError() from err return response.json() diff --git a/requirements-dev.txt b/requirements-dev.txt index 083d0c399c..ecb2858d84 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -14,4 +14,3 @@ types-Authlib==1.5.0.20250516 types-fpdf2==2.8.3.20250516 types-psutil==7.0.0.20250601 types-redis==4.6.0.20241004 -types-requests==2.32.0.20250515 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index f09c236b9d..327938ff0d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,7 +28,6 @@ PyMuPDF==1.26.6 # PDF processing, imported as `fitz` pypdf==6.4.0 python-multipart==0.0.18 # a form data parser, as oauth flow requires form-data parameters redis==5.0.8 -requests==2.32.4 sqlalchemy-utils == 0.41.2 SQLAlchemy[asyncio]==2.0.44 # [asyncio] allows greenlet to be installed on Apple M1 devices. unidecode==1.3.8