diff --git a/src/errors.py b/src/errors.py index 41b17d6..1fbfd40 100644 --- a/src/errors.py +++ b/src/errors.py @@ -65,7 +65,10 @@ def __init__(self, level=DEFAULT, msg='', data=[]): httpcode = self.get_code(level) headers = {'Content-Type': 'application/json'} message = self.get_message(level) - params = web.input() if web.input() else web.data() + if web.ctx.env.get('REQUEST_METHOD', '') == 'GET': + params = web.input() + else: + params = web.data().decode('utf-8') output = json.dumps( self.make_output(httpcode, message, msg, params, data))