httpx_httpclient: pass None when params is empty

see https://github.com/encode/httpx/discussions/3428
This commit is contained in:
lilydjwg 2024-11-30 16:42:57 +08:00
parent c7f571ae79
commit af7acde251

View File

@ -49,7 +49,8 @@ class HttpxSession(BaseSession):
method, url, json = json, content = body,
headers = headers,
follow_redirects = follow_redirects,
params = params,
# httpx checks for None but not ()
params = params or None,
)
err_cls: Optional[type] = None
if r.status_code >= 500: