Update response.py
Type check by isinstance
This commit is contained in:
@@ -80,7 +80,7 @@ class HTTPResponse:
|
|||||||
|
|
||||||
if body is not None:
|
if body is not None:
|
||||||
self.body = body
|
self.body = body
|
||||||
if type(body) is str:
|
if isinstance(body, str):
|
||||||
self.body = body.encode('utf-8')
|
self.body = body.encode('utf-8')
|
||||||
else:
|
else:
|
||||||
self.body = body_bytes
|
self.body = body_bytes
|
||||||
|
|||||||
Reference in New Issue
Block a user