Here’s an edited-down version of the code, which still comes up the same error:
`
// Log the URLs we need
server.log("Drive the car: " + http.agenturl() + “?drive”);
local page = “Hi!”;
function requestHandler(request, response) {
try {
if (“u” in request.query) {
// Process the request.
response.send(200, “sent”);
} else if (“drive” in request.query) {
response.send(200, page)
} else if (“status” in request.query) {
if (device.isconnected()) {
response.send(200, “Connected”);
} else {
response.send(200, “Disconnected”);
}
} else {
// send a response back saying everything was OK.
response.send(200, “Please go to ?drive.”);
}
} catch (ex) {
response.send(500, "Internal Server Error: " + ex);
}
}
// register the HTTP handler
http.onrequest(requestHandler);
`