Changed to use domain name instead of IP address

Fork of IFTTT by Austin Blackstone

Revision:
2:b368358ab24c
Parent:
1:4d2664ecc1e2
Child:
3:c916e13a269a
diff -r 4d2664ecc1e2 -r b368358ab24c ifttt.cpp
--- 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 {