(self, status: int, obj: dict)
| 220 | pass |
| 221 | |
| 222 | def _send_json(self, status: int, obj: dict) -> None: |
| 223 | body = json.dumps(obj).encode() |
| 224 | self.send_response(status) |
| 225 | self.send_header("Content-Type", "application/json") |
| 226 | self.send_header("Content-Length", str(len(body))) |
| 227 | self.end_headers() |
| 228 | self.wfile.write(body) |
| 229 | |
| 230 | def do_GET(self): # noqa: N802 |
| 231 | """Health-check endpoint — returns a friendly JSON status.""" |