If This Then That interface library. Designed to hook up to various services provided by IFTTT.

Dependents:   IFTTT_Ethernet_Example IFTTT_WIZwiki-W7500 IFTTT_WizFi250 StopThief ... more

For more information please see the IFTTT Component page : https:developer.mbed.org/components/If-This-Then-That-IFTTT/

Revision:
2:b368358ab24c
Parent:
1:4d2664ecc1e2
Child:
3:c916e13a269a
--- a/ifttt.cpp	Fri Jul 10 21:58:16 2015 +0000
+++ b/ifttt.cpp	Fri Jul 10 22:12:41 2015 +0000
@@ -158,9 +158,9 @@
     const char * host = "Host: maker.ifttt.com\r\n";
     char contentLen[50] = {0};
     const char * contentType = "Content-Type: application/json\r\n\r\n";
-    char valueData [50] = {0};
+    char valueData [150] = {0};
     sprintf(valueData,"{\"value1\":\"%s\",\"value2\":\"%s\",\"value3\":\"%s\"}\r\n",v1,v2,v3);
-    sprintf(contentLen,"Content-Length: %d\r\n",sizeof(valueData));
+    sprintf(contentLen,"Content-Length: %d\r\n",strlen(valueData));
     sprintf(str,"%s%s%s%s%s",header,host,contentLen,contentType,valueData);
 
     DBG("String to send is:\n\r%s",str);
@@ -168,7 +168,7 @@
     // Send Data
     DBG("Sending POST data...");
     int check = 0;
-    check = this->socket->send_all(str,sizeof(str));
+    check = this->socket->send_all(str,strlen(str));
     if(check) {
         DBG("Sent Sucessfully %d bytes",check);
     } else {