Fix: Support streaming upload from requests. (#3062)

* Fix: Support streaming upload from requests.

* [FIX] style.

Co-authored-by: Gordon Cassie <gordon.cassie@closingfolders.com>
This commit is contained in:
Gordon Cassie 2020-06-11 01:50:50 -04:00 committed by GitHub
commit b88f166099
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -184,6 +184,8 @@ class CallbackResponse(responses.CallbackResponse):
body = None
elif isinstance(request.body, six.text_type):
body = six.BytesIO(six.b(request.body))
elif hasattr(request.body, "read"):
body = six.BytesIO(request.body.read())
else:
body = six.BytesIO(request.body)
req = Request.from_values(