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:
vagrant
2021-03-29 15:53:10 +00:00
committed by Tim Abbott
parent 6f764ce4b3
commit 92f4d206a6

View File

@@ -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",