asdfd
This commit is contained in:
@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user