This commit is contained in:
Wang ChengMeng 2026-06-06 19:40:53 +08:00 committed by GitHub
commit 66a55a1220
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -537,6 +537,9 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
else:
kwargs["json"] = json_data if is_given(json_data) else None
kwargs["files"] = files
# Don't send Content-Type when there's no body content
if not is_given(json_data) and not files:
headers.pop("Content-Type", None)
else:
headers.pop("Content-Type", None)
kwargs.pop("data", None)