1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Python 3.3 fixes.

This commit is contained in:
Jakub Roztocil
2013-01-03 14:54:34 +01:00
parent 0ae9d7af58
commit 79c412064a
2 changed files with 6 additions and 4 deletions

View File

@@ -168,4 +168,8 @@ class HTTPRequest(HTTPMessage):
@property
def body(self):
return self._orig.body or b''
body = self._orig.body
if isinstance(body, str):
# Happens with JSON/form request data parsed from the command line.
body = body.encode('utf8')
return body or b''