Quantcast
Channel: ThingSpeak IoT Community - All Forums
Viewing all articles
Browse latest Browse all 1833

melanogaster on Unable to clear a channel via Arduino

$
0
0

Thanks for the Reply.

I allready tried many changes in the HTTP method.

 

For example i tried this Code:

String apiKeyUser = XXXXXXXXXXXXXXXXXXXX;

String apiKeyChannel = XXXXXXXXXXXXXXXXXXXX;

String channelID = XXXXXX;

if (client.connect(server,80)) { // "184.106.153.149" or api.thingspeak.com
   String postStr = "api_key=";

   postStr += apiKeyUser;
   client.println("DELETE /channels/"+channelID+"/feeds HTTP/1.1");
   client.println("Host: api.thingspeak.com");
   client.println("Connection: close");
   client.println("X-THINGSPEAKAPIKEY: "+apiKeyChannel);
   client.println("Content-Type: application/x-www-form-urlencoded");
   client.print("Content-Length: ");
   client.println(postStr.length());
   client.println();
   client.print(postStr);
}

 

I thought it would work, but it did not.

Also i have no idea why there is this part of the Code:

  client.println("Host: api.thingspeak.com");
   client.println("Connection: close");
   client.println("X-THINGSPEAKAPIKEY: "+apiKeyChannel);
   client.println("Content-Type: application/x-www-form-urlencoded");
   client.print("Content-Length: ");
   client.println(postStr.length());
   client.println();

I think it is there for HTTP coding or something like that.

Still, the Code does not work...

Any ideas?


Viewing all articles
Browse latest Browse all 1833

Latest Images

Trending Articles



Latest Images