<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">many thanks Dear Alex </p>
<p style="margin-top:0;margin-bottom:0">i will make some tests and try it as u mentioned .</p>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Alex Balashov <abalashov@evaristesys.com><br>
<b>Sent:</b> Wednesday, October 17, 2018 8:18 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] HTTP Post with JSON</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Wed, Oct 17, 2018 at 08:01:59PM +0000, eyas barhouk wrote:<br>
<br>
> thanks dear Alex<br>
> <br>
> <br>
> i tried this function "http_client_query(url, [post-data], [hdrs],<br>
> result)" but there is no example about how to use more than one header<br>
> .<br>
> <br>
> <br>
> if you can send me an example about how to setup the query with two<br>
> headers like "content type" & "Authentication "<br>
<br>
You're right, there is no example, and that's unfortunate.<br>
<br>
I just tinkered with it, and it looks like an ordinary newline<br>
delimiter works, but omit the last one:<br>
<br>
In other words:<br>
<br>
Bad --<br>
<br>
        http_client_query("<a href="http://www.evaristesys.com/" id="LPlnk676863" class="OWAAutoLink" previewremoved="true">http://www.evaristesys.com/</a>",
<div id="LPBorder_GT_15398078023530.9386317534438784" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15398078023470.5718280442005876" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15398078023510.11185845263563543" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15398078023510.5593595367097708"></div>
<div id="LPTitle_15398078023510.2891783916614714" style="top: 0px; color: rgb(219, 98, 108); font-weight: 400; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15398078023520.880558370045516" href="http://www.evaristesys.com/" target="_blank" style="text-decoration: none;">Introduction | Evariste Systems</a></div>
<div id="LPMetadata_15398078023530.22350331126738254" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.evaristesys.com</div>
<div id="LPDescription_15398078023530.9829423854516792" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Evariste Systems is a software company specialising in open source-focused VoIP service delivery engineering for Internet Telephony Service Providers (ITSPs) and carriers.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
                "a=1&b=2",<br>
                "Content-Type: application/json\n"<br>
                "Authentication: Basic Z29hdDpjaGVlc2U6cmVhbG0K==\n",<br>
                "$var(result)");<br>
<br>
        POST / HTTP/1.1<br>
        User-Agent: kamailio (5.2.0-pre0 (x86_64/linux))<br>
        Host: <a href="http://www.evaristesys.com" id="LPlnk25139" class="OWAAutoLink" previewremoved="true">
www.evaristesys.com</a><br>
        Accept: */*<br>
        Content-Type: application/json<br>
        Authentication: Basic Z29hdDpjaGVlc2U6cmVhbG0K==<br>
<br>
        Content-Length: 7<br>
<br>
        a=1&b=2<br>
<br>
Good --<br>
<br>
        http_client_query("<a href="http://www.evaristesys.com/" id="LPlnk74678" class="OWAAutoLink" previewremoved="true">http://www.evaristesys.com/</a>",
<br>
                 "a=1&b=2",<br>
                "Content-Type: application/json\n"<br>
                "Authentication: Basic Z29hdDpjaGVlc2U6cmVhbG0K==",<br>
                "$var(result)");<br>
<br>
<br>
        POST / HTTP/1.1<br>
        User-Agent: kamailio (5.2.0-pre0 (x86_64/linux))<br>
        Host: <a href="http://www.evaristesys.com" id="LPlnk433807" class="OWAAutoLink" previewremoved="true">
www.evaristesys.com</a><br>
        Accept: */*<br>
        Content-Type: application/json<br>
        Authentication: Basic Z29hdDpjaGVlc2U6cmVhbG0K==<br>
        Content-Length: 7<br>
<br>
        a=1&b=2<br>
<br>
-- Alex<br>
<br>
-- <br>
Alex Balashov | Principal | Evariste Systems LLC<br>
<br>
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) <br>
Web: <a href="http://www.evaristesys.com/" id="LPlnk700811" class="OWAAutoLink" previewremoved="true">
http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" id="LPlnk770439" class="OWAAutoLink" previewremoved="true">
http://www.csrpswitch.com/</a><br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
sr-users@lists.kamailio.org<br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" id="LPlnk680171" class="OWAAutoLink" previewremoved="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>