Handle POST requests
(self)
| 73 | self.send_error(404, "Not Found") |
| 74 | |
| 75 | def do_POST(self): |
| 76 | """Handle POST requests""" |
| 77 | parsed_path = urlparse(self.path) |
| 78 | path = parsed_path.path |
| 79 | |
| 80 | # Read request body |
| 81 | content_length = int(self.headers.get('Content-Length', 0)) |
| 82 | body = self.rfile.read(content_length).decode('utf-8') if content_length else "" |
| 83 | |
| 84 | if path.startswith('/api/webhook/'): |
| 85 | self.handle_webhook(path, body) |
| 86 | elif path == '/metrics/job/cnc_machine/instance/spindle1': |
| 87 | self.handle_prometheus_push(body) |
| 88 | elif path.startswith('/api/v2/write'): |
| 89 | self.handle_influxdb_write(body) |
| 90 | else: |
| 91 | self.send_error(404, "Not Found") |
| 92 | |
| 93 | def do_PUT(self): |
| 94 | """Handle PUT requests""" |
nothing calls this directly
no test coverage detected