MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / connect_internet

Function connect_internet

src/astroprint/api/setup.py:78–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76@api.route('/setup/internet', methods=['POST'])
77@not_setup_only
78def connect_internet():
79 if "application/json" in request.headers["Content-Type"]:
80 data = request.json
81 if 'id' in data and 'password' in data:
82 result = networkManager().setWifiNetwork(data['id'], data['password'])
83
84 if result:
85 return jsonify(result)
86 else:
87 return make_response("Network %s not found" % data['id'], 404)
88
89 return make_response("Invalid Request", 400)
90
91@api.route('/setup/internet', methods=['PUT'])
92@not_setup_only

Callers

nothing calls this directly

Calls 2

networkManagerFunction · 0.90
setWifiNetworkMethod · 0.45

Tested by

no test coverage detected