MCPcopy Create free account
hub / github.com/cppla/ServerStatus / send_json

Method send_json

server/manage_api.py:323–329  ·  view source on GitHub ↗
(self, status, payload)

Source from the content-addressed store, hash-verified

321 super().end_headers()
322
323 def send_json(self, status, payload):
324 data = json.dumps(payload, ensure_ascii=False).encode("utf-8")
325 self.send_response(status)
326 self.send_header("Content-Type", "application/json; charset=utf-8")
327 self.send_header("Content-Length", str(len(data)))
328 self.end_headers()
329 self.wfile.write(data)
330
331 def send_error_json(self, err):
332 payload = {"ok": False, "error": err.message}

Callers 2

send_error_jsonMethod · 0.95
routeMethod · 0.95

Calls 1

end_headersMethod · 0.95

Tested by

no test coverage detected