MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / _json

Method _json

examples/bring-your-own-container/app.py:33–39  ·  view source on GitHub ↗
(self, code, body)

Source from the content-addressed store, hash-verified

31 self._json(404, {"error": "not found"})
32
33 def _json(self, code, body):
34 payload = json.dumps(body).encode()
35 self.send_response(code)
36 self.send_header("Content-Type", "application/json")
37 self.send_header("Content-Length", str(len(payload)))
38 self.end_headers()
39 self.wfile.write(payload)
40
41 # Suppress per-request log lines for cleaner output.
42 def log_message(self, format, *args):

Callers 1

do_GETMethod · 0.95

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected