I have utilized the WiFi Library on the Arduino website and have looked at various other codes on the internet, yet have not found a thorough explanation that helps me understand exactly the function of lines utilized to push data to Thingspeak. Most codes are similar, so I am pasting below, as a couple examples, similar scripts found on the Arduino website. I would greatly appreciate either:
(1) directing me to a resource that helps me understand the function and format of each line or
(2) providing personal insight.
Thank you in advance.
Ex 1:
client.print("POST /update HTTP/1.1\n");
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: "+apiWritekey+"\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(tsData.length());
client.print("\n\n");
client.print(tsData);
Ex 2:
client.print("POST /update HTTP/1.1\n");
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: " + writeAPIKey + "\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(body.length());
client.print("\n\n");
client.print(body);
client.print("\n\n");