Improvement

improvement: support fo binary data as a input. This do that the response process has more performance because not encoding needed.
This commit is contained in:
cr0hn 2016-12-23 13:12:59 +01:00 committed by GitHub
parent ef9d8710f5
commit f091d82bad

View File

@ -79,6 +79,8 @@ class HTTPResponse:
self.content_type = content_type self.content_type = content_type
if body is not None: if body is not None:
self.body = body
if type(body) is str:
self.body = body.encode('utf-8') self.body = body.encode('utf-8')
else: else:
self.body = body_bytes self.body = body_bytes