Skip to content

Commit

Permalink
fix streaming boby dump issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gangtao committed Jun 24, 2023
1 parent 5761b09 commit 201cf46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion python/swagger_client/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,12 @@ def request(self, method, url, query_params=None, headers=None,
url += '?' + urlencode(query_params)
if re.search('json', headers['Content-Type'], re.IGNORECASE):
request_body = '{}'
if body is not None:
# no need to dump in case body is already a string
if not isinstance(body, str):
request_body = json.dumps(body)
else:
request_body = body

r = self.pool_manager.request(
method, url,
body=request_body,
Expand Down
2 changes: 1 addition & 1 deletion python/timeplus/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.2.2" # noqa: F401
__version__ = "1.3.0b0" # noqa: F401

0 comments on commit 201cf46

Please sign in to comment.