This commit is contained in:
2025-04-12 23:51:17 -04:00
parent df6490cab0
commit 56c2d1de47
2870 changed files with 3700 additions and 206 deletions

View File

@ -26,8 +26,9 @@ class BaseExternalService:
params: Optional[Dict[str, Any]] = None,
headers: Optional[Dict[str, str]] = None,
data: Optional[Dict[str, Any]] = None,
content_type: str = "application/json"
) -> Union[Dict[str, Any], str]:
content_type: str = "application/json",
binary: bool = False
) -> Union[Dict[str, Any], str, bytes]:
session = await self._get_session()
url = f"{self.base_url}{endpoint}"
@ -43,6 +44,9 @@ class BaseExternalService:
response_content_type = response.headers.get('content-type', '').lower()
logger.info(f"Making request to {url}")
if binary:
return await response.read()
# Get the raw response text first
raw_response = await response.text()