def process(self): request = gf.load(string=self.body['request'][0]) try: resp = self.server.engine.process(request=request) except (gf.BadRequest, gf.StoreError), e: self.send_error(400, str(e)) return
def process(self): request = gf.load(string=self.body['request'][0]) try: resp = self.server.engine.process(request=request) except (gf.BadRequest, gf.StoreError) as e: self.send_error(400, str(e)) return f = BytesIO() resp.dump(stream=f) length = f.tell() f.seek(0) self.send_response(200, 'OK') self.send_header("Content-Type", "text/html; charset=utf-8") self.send_header("Content-Length", str(length)) self.end_headers() return f