<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HTTP post in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-post/m-p/276762#M8577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please try to use function strlen instead of sizeof in calls of send() function. Using sizeof in this context means that you also send terminating null character ('\0') in your messages, which is probably why you cannot receive any other than first message. Also on line 16 you are calling sizeof(formkey). I assume, that variable formkey is pointer so sizeof will return 4, which is probably not what you want. If you want to get length of string formkey is pointing to you should use strlen(formkey).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Karel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Sep 2013 12:39:13 GMT</pubDate>
    <dc:creator>karelm_</dc:creator>
    <dc:date>2013-09-30T12:39:13Z</dc:date>
    <item>
      <title>HTTP post</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-post/m-p/276761#M8576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13775853042872321" jivemacro_uid="_13775853042872321"&gt;
&lt;/PRE&gt;&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;strcat (cServer_WriteBuff,"entry.1446189103=");&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;strcat (cServer_WriteBuff,POST);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;strcat (cServer_WriteBuff,"&amp;amp;submit=Submit");&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;value = strlen(cServer_WriteBuff);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;error = send(sock, "POST /formResponse?formkey=", sizeof("POST /formResponse?formkey="), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;error = send(sock, (void *)formkey, sizeof(formkey), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;/TD&gt;
&lt;TD&gt;error = send(sock, "&amp;amp;ifq HTTP/1.1\r\n", sizeof("&amp;amp;ifq HTTP/1.1\r\n"), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;error = send(sock, "Host: spreadsheets.google.com\r\n", sizeof("Host: spreadsheets.google.com\r\n"), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;/TD&gt;
&lt;TD&gt;error = send(sock, "Content-Type: application/x-www-form-urlencoded\r\n", sizeof("Content-Type: application/x-www-form-urlencoded\r\n"), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;error = send(sock, "Connection: close\r\n", sizeof("Connection: close\r\n"), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;/TD&gt;
&lt;TD&gt;error = send(sock, (void *)value, sizeof(value), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;error = send(sock, "\r\n", sizeof("\r\n"), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;error = send(sock, "\r\n", sizeof("\r\n"), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;error = send(sock, (void *)cServer_WriteBuff, sizeof(cServer_WriteBuff), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;error = send(sock, "\r\n", sizeof("\r\n"), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;error = send(sock, "\r\n", sizeof("\r\n"), 0);&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp; 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.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 06:32:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-post/m-p/276761#M8576</guid>
      <dc:creator>Swapnil_Enable</dc:creator>
      <dc:date>2013-08-27T06:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP post</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-post/m-p/276762#M8577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please try to use function strlen instead of sizeof in calls of send() function. Using sizeof in this context means that you also send terminating null character ('\0') in your messages, which is probably why you cannot receive any other than first message. Also on line 16 you are calling sizeof(formkey). I assume, that variable formkey is pointer so sizeof will return 4, which is probably not what you want. If you want to get length of string formkey is pointing to you should use strlen(formkey).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Karel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 12:39:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-post/m-p/276762#M8577</guid>
      <dc:creator>karelm_</dc:creator>
      <dc:date>2013-09-30T12:39:13Z</dc:date>
    </item>
  </channel>
</rss>

