|
| 1 | +<!-- |
| 2 | + The example codes and outputs below are generated using the `embedmd` go |
| 3 | + package. |
| 4 | +
|
| 5 | + https://github.com/campoy/embedmd |
| 6 | +
|
| 7 | + You should regenerate the example codes after making any changes to |
| 8 | + examples in the test/examples/ folder. |
| 9 | +
|
| 10 | + embedmd -w README.md |
| 11 | + --> |
| 12 | + |
1 | 13 | [](https://travis-ci.com/IBM/cloudant-python-sdk)
|
2 | 14 | [](https://github.com/IBM/cloudant-python-sdk/releases/latest)
|
3 | 15 | [](https://ibm.github.io/cloudant-python-sdk/)
|
@@ -513,22 +525,44 @@ For sample code on handling errors, see
|
513 | 525 | ### Raw IO
|
514 | 526 |
|
515 | 527 | For endpoints that read or write document content it is possible to bypass
|
516 |
| -usage of the built-in models and send or receive a bytes response. |
517 |
| -For examples of using byte streams, see the API reference documentation |
518 |
| -("Example request as a stream" section). |
| 528 | +usage of the built-in object with byte streams. |
| 529 | + |
| 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 | + |
| 534 | +Request byte stream can be supplied for arguments that accept the `BinaryIO` type. |
| 535 | +For these cases you can pass this byte stream directly to the HTTP request body. |
| 536 | + |
| 537 | +Response byte stream is supported in functions with the suffix of `_as_stream`. |
| 538 | +The returned byte stream allows the response body to be consumed |
| 539 | +without triggering JSON unmarshalling that is typically performed by the SDK. |
| 540 | + |
| 541 | +The [update document](#3-update-your-previously-created-document) section |
| 542 | +contains examples for both request and response byte stream cases. |
| 543 | + |
| 544 | +The API reference contains further examples of using byte streams. |
| 545 | +They are titled "Example request as stream" and are initially collapsed. |
| 546 | +Expand them to see examples of: |
| 547 | + |
| 548 | +- Byte requests: |
| 549 | + - [Bulk modify multiple documents in a database](https://cloud.ibm.com/apidocs/cloudant?code=python#postbulkdocs) |
519 | 550 |
|
520 |
| -- [Bulk modify multiple documents in a database](https://cloud.ibm.com/apidocs/cloudant?code=python#postbulkdocs) |
521 |
| -- [Query a list of all documents in a database](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) |
522 |
| -- [Query the database document changes feed](https://cloud.ibm.com/apidocs/cloudant?code=python#postchanges) |
| 551 | +- Byte responses: |
| 552 | + - [Query a list of all documents in a database](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) |
| 553 | + - [Query the database document changes feed](https://cloud.ibm.com/apidocs/cloudant?code=python#postchanges) |
523 | 554 |
|
524 | 555 | ### Further resources
|
525 | 556 |
|
526 | 557 | - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python):
|
527 | 558 | API reference including usage examples for Cloudant Python SDK API.
|
528 | 559 | - [Pydoc](https://ibm.github.io/cloudant-python-sdk/):
|
529 | 560 | Cloudant Python SDK API Documentation.
|
530 |
| -- [Cloudant docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant): |
| 561 | +- [Cloudant docs](https://cloud.ibm.com/docs/services/Cloudant?topic=cloudant-overview#overview): |
531 | 562 | The official documentation page for Cloudant.
|
| 563 | +- [Cloudant Learning Center](https://developer.ibm.com/clouddataservices/docs/compose/cloudant/): |
| 564 | + The official learning center with several useful videos which help you use |
| 565 | + Cloudant successfully. |
532 | 566 | - [Cloudant blog](https://blog.cloudant.com/):
|
533 | 567 | Many useful articles about how to optimize Cloudant for common problems.
|
534 | 568 |
|
|
0 commit comments