mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
documentation: Update upload_file python api documentation.
The current API documentation uses call_endpoint to upload a file; since we've added a custom helper in python-zulip-api, we should document that cleaner approach.
This commit is contained in:
@@ -1055,12 +1055,9 @@ def upload_file(client: Client) -> None:
|
||||
# {code_example|start}
|
||||
# Upload a file
|
||||
with open(path_to_file, "rb") as fp:
|
||||
result = client.call_endpoint(
|
||||
"user_uploads",
|
||||
method="POST",
|
||||
files=[fp],
|
||||
)
|
||||
result = client.upload_file(fp)
|
||||
|
||||
# Share the file by including it in a message.
|
||||
client.send_message(
|
||||
{
|
||||
"type": "stream",
|
||||
|
||||
Reference in New Issue
Block a user