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: else:
reco = aiohttp.ClientSession() reco = aiohttp.ClientSession()
async with reco as session: async with reco as session:
if params == {}: hp = {
params = None }
if data == {}: if params:
data = None hp['params'] = params
if jd == {}: if data:
jd = None hp['data'] = data
if jd:
hp['jd'] = jd
if headers == {}: if headers:
headers = None hp['headers'] = headers
ssl_ctx = None
if url.startswith('https://'): 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, return await session.request(method, url,
params=params, params=params,
data=data, data=data,