From 69cddd1be9cda4434e46b07e0445f530886e0dc2 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:07:55 +0000 Subject: [PATCH] fix(generated): correct name to new snippets in examples README Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version 5284919 --- examples/README.md | 19 +++++++++++++++++++ .../example_request_as_a_stream.py | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 examples/snippets/postDocument/example_request_as_a_stream.py diff --git a/examples/README.md b/examples/README.md index 6bb22b35..3331e4b2 100644 --- a/examples/README.md +++ b/examples/README.md @@ -656,6 +656,25 @@ response = service.post_document(db='products', document=products_doc).get_resul print(response) ``` +### [Example request as a stream](snippets/postDocument/example_request_as_a_stream.py) + +[embedmd]:# (snippets/postDocument/example_request_as_a_stream.py) +```py +# section: code +from ibmcloudant.cloudant_v1 import Document, CloudantV1 + +service = CloudantV1.new_instance() + +with open("products_doc.json", "rb") as products_doc: + response = service.post_document( + db='products', + document=products_doc_binary, + content_type="application/json" + ).get_result() + +print(response) +``` + ## putDatabase _PUT `/{db}`_ diff --git a/examples/snippets/postDocument/example_request_as_a_stream.py b/examples/snippets/postDocument/example_request_as_a_stream.py new file mode 100644 index 00000000..879ddbee --- /dev/null +++ b/examples/snippets/postDocument/example_request_as_a_stream.py @@ -0,0 +1,13 @@ +# section: code +from ibmcloudant.cloudant_v1 import Document, CloudantV1 + +service = CloudantV1.new_instance() + +with open("products_doc.json", "rb") as products_doc: + response = service.post_document( + db='products', + document=products_doc_binary, + content_type="application/json" + ).get_result() + +print(response)