Skip to content
Browse files

fix for utf-8 encoding POST data

  • Loading branch information...
1 parent afec643 commit 8af533fe5587542e85ca8f7741d9463c84196583 @peterbe committed Nov 22, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 tornado_utils/http_test_client.py
View
5 tornado_utils/http_test_client.py
@@ -3,7 +3,7 @@
from tornado.httpclient import HTTPRequest
from tornado import escape
-__version__ = '1.2'
+__version__ = '1.3'
class LoginError(Exception):
pass
@@ -24,6 +24,9 @@ def get(self, url, data=None, headers=None, follow_redirects=False):
def post(self, url, data, headers=None, follow_redirects=False):
if data is not None:
if isinstance(data, dict):
+ for key, value in data.items():
+ if isinstance(value, unicode):
+ data[key] = value.encode('utf-8')
data = urlencode(data, True)
return self._fetch(url, 'POST', data, headers,
follow_redirects=follow_redirects)

0 comments on commit 8af533f

Please sign in to comment.
Something went wrong with that request. Please try again.