<div><div dir="auto">Check data on wire between actual and expected ngrep or tcpdump... it looks like your response is not a kamailio reply, yet web server returns the 400 / response.</div><br><div class="gmail_quote"><div>On Thu, Jul 13, 2017 at 1:40 AM Abdul Basit <<a href="mailto:basit.engg@gmail.com">basit.engg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br><div class="gmail_extra"><div class="gmail_quote"><div><div>Hi folks, <br><br></div><div>I am using  <span style="font-family:times new roman,serif">kamailio -v</span><br><span style="font-family:times new roman,serif">version: kamailio 5.0.2 (x86_64/linux) <br>flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES<br>ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>id: unknown <br>compiled on 10:02:27 Jul  4 2017 with gcc 4.9.2</span><br> </div></div></div></div></div><div><div class="gmail_extra"><div class="gmail_quote"><div><div><br></div>I was trying to send http POST request to my web server <a href="http://example.com" target="_blank">example.com</a> following example <a href="https://www.kamailio.org/docs/modules/5.0.x/modules/http_async_client.html#http_async_client.f.http_async_query" target="_blank">Example 1.12. http_async_query() usage</a><div><div><br><a href="https://www.kamailio.org/docs/modules/5.0.x/modules/http_async_client.html" target="_blank">https://www.kamailio.org/docs/modules/5.0.x/modules/http_async_client.html</a><br><br></div><div>according to that we should send parameters in body like<br><pre class="m_-7868067998966589113gmail-m_-5730796690091393150gmail-programlisting" style="font-family:monospace;white-space:pre-wrap;background-color:rgb(252,255,252);border-width:1px;border-style:solid;border-color:rgb(153,204,204);color:rgb(0,0,0);padding-left:15pt;overflow:auto;border-radius:2.5px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><font size="2"># POST
$http_req(body) = "{'r_uri':'" + $rU + "', 'f_uri':'" + $fU + "'}";
http_async_query("<a href="http://example.com/test.php" target="_blank">http://example.com/test.php</a>", "HTTP_REPLY");</font></pre></div><div>But its not working out of the box as described with error message from server:<br><br><font size="2"><span style="font-family:garamond,serif"><span style="background-color:rgb(207,226,243)">INFO: <script>: route[HTTP_REPLY]: status 400<br>INFO: <script>: route[HTTP_REPLY]: body Insufficient parameters.</span></span><span style="font-family:monospace,monospace"><br></span></font><br></div><div>I even tried adding additional parameters<br>  <span style="font-family:times new roman,serif">$http_req(hdr) = "Content-Type: application/x-www-form-urlencoded";     <br>  $http_req(method) = "POST";</span> <br></div><div><br>But again it didn't work.<br></div><div><br></div><div>I tried the alternative way which worked fine.<br></div><div style="text-align:left"><pre class="m_-7868067998966589113gmail-m_-5730796690091393150gmail-programlisting" style="font-family:monospace;white-space:pre-wrap;background-color:rgb(252,255,252);border-width:1px;border-style:solid;border-color:rgb(153,204,204);color:rgb(0,0,0);padding-left:15pt;overflow:auto;border-radius:2.5px;font-size:15px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><font size="2"># POST
$http_req(body) = "r_uri=$rU&f_uri=$fU";
http_async_query("<a href="http://example.com/test.php" target="_blank">http://example.com/test.php</a>", "HTTP_REPLY"); </font><br></pre></div><div>Is there any issue with documentation or i am missing something for POST request?<br></div><div><br clear="all"><div><div class="m_-7868067998966589113gmail-m_-5730796690091393150gmail_signature"><div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)">--<br>regards,</span></span></font></div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)"><br>abdul basit | p: +92 32 1416 4196 | o: +92 30 0841 1445</span></span></font></div></div>
</div></div></div>
</div></div></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature">Sent from Gmail Mobile</div>