Skip to content

Instantly share code, notes, and snippets.

@jonathanhculver
Created June 24, 2013 03:26
Show Gist options
  • Select an option

  • Save jonathanhculver/5847581 to your computer and use it in GitHub Desktop.

Select an option

Save jonathanhculver/5847581 to your computer and use it in GitHub Desktop.
http header
void printWebResponse(WiFiClient client, String lightStatus) {
Serial.println();
// so the http request has ended and we can send a reply
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Access-Control-Allow-Origin: *");
client.println("Content-Type: text/html");
client.println();
client.println("{\"status\":\""+lightStatus+"\"}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment