Skip to content

Commit

Permalink
Fix payload on stream requests
Browse files Browse the repository at this point in the history
  • Loading branch information
alfred82santa committed Jun 9, 2016
1 parent 94046c8 commit d0c706b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ In order to send a payload you must use ``payload`` keyword on call:
Changelog
=========

v0.5.1
------

- Resolved problem with requests streamed.

v0.5.0
------

Expand Down
11 changes: 7 additions & 4 deletions service_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ def call(self, endpoint, payload=None, **kwargs):
stream_request = endpoint_desc['stream_request']
except KeyError:
stream_request = False
if payload and not stream_request:
request_params['data'] = self.serializer(payload, session=session,
endpoint_desc=endpoint_desc,
request_params=request_params)
if payload:
if stream_request:
request_params['data'] = payload
else:
request_params['data'] = self.serializer(payload, session=session,
endpoint_desc=endpoint_desc,
request_params=request_params)

yield from self.before_request(endpoint_desc, session, request_params)
task = Task.current_task(loop=self.loop)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name='aio-service-client',
url='https://github.com/alfred82santa/aio-service-client',
author='alfred82santa',
version='0.5.0',
version='0.5.1',
license='LGPLv3',
author_email='alfred82santa@gmail.com',
classifiers=[
Expand Down

0 comments on commit d0c706b

Please sign in to comment.