MCPcopy Create free account
hub / github.com/bdring/FluidNC / do_POST

Method do_POST

examples/http_command/http_command_server.py:75–91  ·  view source on GitHub ↗

Handle POST requests

(self)

Source from the content-addressed store, hash-verified

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"""

Callers

nothing calls this directly

Calls 6

handle_webhookMethod · 0.95
handle_influxdb_writeMethod · 0.95
decodeMethod · 0.80
getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected