These are chat archives for cherrypy/cherrypy

25th
Apr 2018
dddh
@dddh
Apr 25 2018 18:09
seems like @cherrypy.tools.json_in() doesn't like when I post compressed json data
but json.loads(zlib.decompress(cherrypy.request.body.read())) works fine
Jason R. Coombs
@jaraco
Apr 25 2018 18:55
@dddh: That sounds right. I wouldn’t expect it to magically decompress request bodies.
dddh
@dddh
Apr 25 2018 19:06
that data was posted using: requests.post(URL, data=zlib.compress(json.dumps(JSON).encode('utf-8'), zlib.Z_BEST_COMPRESSION), headers={'Content-Encoding': 'gzip', 'Content-Type': 'application/json'})
doesn't matter if it works any other way of course