IBM / python-sdk-core

The python-sdk-core repository contains core functionality required by Python code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
20 stars 27 forks source link

feat(BaseService): support stream=True in BaseService.send() #78

Closed padamstx closed 4 years ago

padamstx commented 4 years ago

Fixes: arf/planning-sdk-squad/issues/901

This change allows generated operation code to pass 'stream=True' to the BaseService.send() method, which will in turn pass it on to the underlying requests.request() method. The net result is that the response body (even if it is a JSON object) will be "streamed", which means it will be made available via the requests.Response object rather than consumed and set on the DetailedResponse object. To access the streamed response, simply retrieve the requests.Response object by calling DetailedResponse.get_result(), then use the "iter_content" method on the returned requests.Response instance.

codecov[bot] commented 4 years ago

Codecov Report

Merging #78 into master will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #78   +/-   ##
=======================================
  Coverage   97.96%   97.97%           
=======================================
  Files          18       18           
  Lines         640      643    +3     
=======================================
+ Hits          627      630    +3     
  Misses         13       13           
Impacted Files Coverage Δ
ibm_cloud_sdk_core/base_service.py 94.00% <100.00%> (+0.12%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7c6ad8b...2b13889. Read the comment docs.

ibm-devx-automation commented 4 years ago

:tada: This PR is included in version 3.1.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: