AnsweredAssumed Answered

HTTP post

Question asked by Swapnil Katre on Aug 26, 2013
Latest reply on Sep 30, 2013 by Karel Mozny

Hi i am trying to POST data to Google spreadsheet like andrino, but i am not able succeed. i have return the code for POST.

 




strcat (cServer_WriteBuff,"entry.1446189103=");


strcat (cServer_WriteBuff,POST);


strcat (cServer_WriteBuff,"&submit=Submit");


value = strlen(cServer_WriteBuff);


error = send(sock, "POST /formResponse?formkey=", sizeof("POST /formResponse?formkey="), 0);


error = send(sock, (void *)formkey, sizeof(formkey), 0);



error = send(sock, "&ifq HTTP/1.1\r\n", sizeof("&ifq HTTP/1.1\r\n"), 0);


error = send(sock, "Host: spreadsheets.google.com\r\n", sizeof("Host: spreadsheets.google.com\r\n"), 0);



error = send(sock, "Content-Type: application/x-www-form-urlencoded\r\n", sizeof("Content-Type: application/x-www-form-urlencoded\r\n"), 0);


error = send(sock, "Connection: close\r\n", sizeof("Connection: close\r\n"), 0);



error = send(sock, (void *)value, sizeof(value), 0);


error = send(sock, "\r\n", sizeof("\r\n"), 0);


error = send(sock, "\r\n", sizeof("\r\n"), 0);


error = send(sock, (void *)cServer_WriteBuff, sizeof(cServer_WriteBuff), 0);


error = send(sock, "\r\n", sizeof("\r\n"), 0);


error = send(sock, "\r\n", sizeof("\r\n"), 0);




  but when i check it on Hercules terminal, it only shows " POST /formResponse?formkey=" can anyone please help to figure out, or any suggestion. i am tring to use httpsrv code but being a beginner not able to figure how to use it.

Outcomes