mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-07-27 09:55:47 +00:00
fix: omit Content-Type header when request body is empty (#40)
This commit is contained in:
parent
817f1a0816
commit
356edf427a
1 changed files with 3 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue