FastLED 3.9.15
Loading...
Searching...
No Matches

◆ send_json_response()

None test_server.HTTPBinHandler.send_json_response ( self,
dict[str, Any] data,
int status_code = 200 )
Send JSON response with appropriate headers.

Definition at line 33 of file test_server.py.

33 def send_json_response(self, data: dict[str, Any], status_code: int = 200) -> None:
34 """Send JSON response with appropriate headers."""
35 json_data = json.dumps(data, indent=2)
36 self.send_response(status_code)
37 self.send_header("Content-Type", "application/json")
38 self.send_header("Content-Length", str(len(json_data)))
39 self.send_header("Access-Control-Allow-Origin", "*")
40 self.end_headers()
41 self.wfile.write(json_data.encode())
42

References fl::asio::http::Server.send_response().

Referenced by do_POST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: