MCPcopy
hub / github.com/Sophomoresty/gemini-web2api / send_json

Method send_json

gemini_web2api/server.py:47–54  ·  view source on GitHub ↗
(self, data, status=200)

Source from the content-addressed store, hash-verified

45 log(fmt % args)
46
47 def send_json(self, data, status=200):
48 body = json.dumps(data, ensure_ascii=False).encode()
49 self.send_response(status)
50 self.send_header("Content-Type", "application/json")
51 self.send_header("Access-Control-Allow-Origin", "*")
52 self.send_header("Content-Length", str(len(body)))
53 self.end_headers()
54 self.wfile.write(body)
55
56 def _start_sse(self):
57 self.send_response(200)

Callers 5

do_GETMethod · 0.95
do_POSTMethod · 0.95
_handle_chatMethod · 0.95
_handle_responsesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected