mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-05-17 04:12:43 +00:00
feat(client): support file upload requests
This commit is contained in:
parent
a4212485db
commit
34ccc7f7d7
2 changed files with 8 additions and 5 deletions
|
|
@ -532,7 +532,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|||
is_body_allowed = options.method.lower() != "get"
|
||||
|
||||
if is_body_allowed:
|
||||
kwargs["json"] = json_data if is_given(json_data) else None
|
||||
if isinstance(json_data, bytes):
|
||||
kwargs["content"] = json_data
|
||||
else:
|
||||
kwargs["json"] = json_data if is_given(json_data) else None
|
||||
kwargs["files"] = files
|
||||
else:
|
||||
headers.pop("Content-Type", None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue