sending JSON response from HTTP server in python -
i'm trying send data json object python http server client. here do_post function use client request: def do_post(self): if none != re.search('/compile/*', self.path): ctype, pdict = cgi.parse_header(self.headers.getheader('content-type')) print "ctype = %s", ctype if ctype == 'application/json': length = int(self.headers.getheader('content-length')) data = json.loads(self.rfile.read(length)) response = doeverything(data["userid"], data["files"]) ##response = json.dump(response, self.wfile) response = json.dumps(response) self.send_response(0) self.end_headers() self.wfile.write(str(response)) print 'everything ok' el...