This commit is contained in:
yumoqing 2025-06-07 19:36:39 +08:00
parent 003ff36471
commit db7652502a

View File

@ -141,18 +141,20 @@ class HttpClient:
else:
reco = aiohttp.ClientSession()
async with reco as session:
if params == {}:
params = None
if data == {}:
data = None
if jd == {}:
jd = None
hp = {
}
if params:
hp['params'] = params
if data:
hp['data'] = data
if jd:
hp['jd'] = jd
if headers == {}:
headers = None
ssl_ctx = None
if headers:
hp['headers'] = headers
if url.startswith('https://'):
ssl_ctx = ssl.create_default_context(cafile=certifi.where())
hp['ssl_ctx'] = ssl.create_default_context(cafile=certifi.where())
# debug(f'{url=}, {hp=}')
return await session.request(method, url,
params=params,
data=data,