@@ -525,13 +525,33 @@ For sample code on handling errors, see
525
525
### Raw IO
526
526
527
527
For endpoints that read or write document content it is possible to bypass
528
- usage of the built-in models and send or receive a bytes response.
529
- For examples of using byte streams, see the API reference documentation
530
- ("Example request as a stream" section).
528
+ usage of the built-in models with byte streams.
531
529
532
- - [ Bulk modify multiple documents in a database] ( https://cloud.ibm.com/apidocs/cloudant?code=python#postbulkdocs )
533
- - [ Query a list of all documents in a database] ( https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs )
534
- - [ Query the database document changes feed] ( https://cloud.ibm.com/apidocs/cloudant?code=python#postchanges )
530
+ Depending on the specific SDK operation it may be possible to:
531
+ * accept a user-provided byte stream to send to the server as a request body
532
+ * return a byte stream of the server response body to the user
533
+ * use byte streams for both the request and response bodies
534
+
535
+ Request byte stream can be supplied for arguments that accept the ` BinaryIO ` type.
536
+ The model objects support passing this byte stream value to the request body.
537
+
538
+ Response byte stream is supported in functions with the suffix of ` AsStream ` .
539
+ The returned byte stream allows the response body to be consumed
540
+ without triggering JSON unmarshalling that is typically performed by the SDK.
541
+
542
+ The [ update document] ( #3-update-your-previously-created-document ) section
543
+ contains examples for both request and response byte stream cases.
544
+
545
+ The API reference contains further examples of using byte streams.
546
+ They are titled "Example request as stream" and are initially collapsed.
547
+ Expand them to see examples of:
548
+
549
+ - Byte requests:
550
+ - [ Bulk modify multiple documents in a database] ( https://cloud.ibm.com/apidocs/cloudant?code=python#postbulkdocs )
551
+
552
+ - Byte responses:
553
+ - [ Query a list of all documents in a database] ( https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs )
554
+ - [ Query the database document changes feed] ( https://cloud.ibm.com/apidocs/cloudant?code=python#postchanges )
535
555
536
556
### Further resources
537
557
0 commit comments