respect request charset

This commit is contained in:
Steve Romanow 2011-05-18 18:16:48 -04:00
parent 8b974eb355
commit 58a9040444

View file

@ -73,7 +73,13 @@ class Request(RequestBase):
if __debug__:
_assert_have_json()
if self.mimetype == 'application/json':
return json.loads(self.data)
request_charset = self.mimetype_params.get('charset')
if request_charset is not None:
j = json.loads(self.data, encoding=request_charset )
else:
j = json.loads(self.data)
return j
class Response(ResponseBase):