diff --git a/utils/http_utils.py b/utils/http_utils.py index aa4b97b3..46e0a00e 100644 --- a/utils/http_utils.py +++ b/utils/http_utils.py @@ -30,6 +30,7 @@ class AsyncHttpx: params: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, cookies: Optional[Dict[str, str]] = None, + verify: bool = True, use_proxy: bool = True, proxy: Dict[str, str] = None, timeout: Optional[int] = 30, @@ -50,7 +51,7 @@ class AsyncHttpx: if not headers: headers = get_user_agent() proxy = proxy if proxy else cls.proxy if use_proxy else None - async with httpx.AsyncClient(proxies=proxy) as client: + async with httpx.AsyncClient(proxies=proxy,verify=verify) as client: return await client.get( url, params=params, @@ -68,6 +69,7 @@ class AsyncHttpx: data: Optional[Dict[str, str]] = None, content: Any = None, files: Any = None, + verify: bool = True, use_proxy: bool = True, proxy: Dict[str, str] = None, json: Optional[Dict[str, Union[Any]]] = None, @@ -96,7 +98,7 @@ class AsyncHttpx: if not headers: headers = get_user_agent() proxy = proxy if proxy else cls.proxy if use_proxy else None - async with httpx.AsyncClient(proxies=proxy) as client: + async with httpx.AsyncClient(proxies=proxy,verify=verify) as client: return await client.post( url, content=content, @@ -117,6 +119,7 @@ class AsyncHttpx: path: Union[str, Path], *, params: Optional[Dict[str, str]] = None, + verify: bool = True, use_proxy: bool = True, proxy: Dict[str, str] = None, headers: Optional[Dict[str, str]] = None, @@ -169,7 +172,7 @@ class AsyncHttpx: headers = get_user_agent() proxy = proxy if proxy else cls.proxy if use_proxy else None try: - async with httpx.AsyncClient(proxies=proxy) as client: + async with httpx.AsyncClient(proxies=proxy,verify=verify) as client: async with client.stream( "GET", url,