MCPcopy Create free account
hub / github.com/NyarchLinux/DesktopPuppet / do_GET

Method do_GET

src/interaction_handler.py:7–28  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5class InteractionHandler(BaseHTTPRequestHandler):
6
7 def do_GET(self):
8 if self.path == '/expressions':
9 expressions = self.server.interaction_server.get_expressions()
10 response = json.dumps(expressions).encode('utf-8')
11
12 self.send_response(200)
13 self.send_header("Content-Type", "application/json")
14 self.send_header("Content-Length", str(len(response)))
15 self.end_headers()
16 self.wfile.write(response)
17 elif self.path == '/motions':
18 motions = self.server.interaction_server.get_motions()
19 response = json.dumps(motions).encode('utf-8')
20
21 self.send_response(200)
22 self.send_header("Content-Type", "application/json")
23 self.send_header("Content-Length", str(len(response)))
24 self.end_headers()
25 self.wfile.write(response)
26 else:
27 self.send_response(404)
28 self.end_headers()
29
30 def do_POST(self):
31 # Read the request body.

Callers

nothing calls this directly

Calls 2

get_expressionsMethod · 0.45
get_motionsMethod · 0.45

Tested by

no test coverage detected