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

Method send_json

gemini_web2api.py:431–438  ·  view source on GitHub ↗
(self, data, status=200)

Source from the content-addressed store, hash-verified

429 log(fmt % args)
430
431 def send_json(self, data, status=200):
432 body = json.dumps(data, ensure_ascii=False).encode()
433 self.send_response(status)
434 self.send_header("Content-Type", "application/json")
435 self.send_header("Access-Control-Allow-Origin", "*")
436 self.send_header("Content-Length", str(len(body)))
437 self.end_headers()
438 self.wfile.write(body)
439
440 def _authorized(self):
441 keys = CONFIG.get("api_keys") or []

Callers 6

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