<div dir="ltr">Hi there,<div><br></div><div>Anyone out there with some experience shed some light on this?</div><div><br></div><div>Looking to set the <span class="" style="font-size:12.727272033691406px;font-family:arial,sans-serif">Content</span><span style="font-size:12.727272033691406px;font-family:arial,sans-serif">-</span><span class="" style="font-size:12.727272033691406px;font-family:arial,sans-serif">Type in mod_curl</span><span style="font-size:12.727272033691406px;font-family:arial,sans-serif"> header so that the server with recognize that the format of that data being send. For example &#39;application/JSON&#39;</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 29, 2014 at 12:36 AM, Jeff Stark <span dir="ltr">&lt;<a href="mailto:jstark888@gmail.com" target="_blank">jstark888@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>More info on the problem:</div><div><br></div><div>[DEBUG] mod_curl.c:166 method: post, url: http://&lt;private IP&gt;:8080/PushServer/api/push, content-type: (null)<br>
</div><div><br>
</div><div>So for some reason mod_curl is not setting the Content-Type header at all, which is what I think is causing my web server to complain.</div><div><br></div><div>Thanks.</div><span class="HOEnZb"><font color="#888888"><div>
<br></div><div>Jeff</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, May 28, 2014 at 4:49 PM, Jeff Stark <span dir="ltr">&lt;<a href="mailto:jstark888@gmail.com" target="_blank">jstark888@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Hi,<div><br></div><div>Is there a way to set the Content-Type header when using mod_curl in a Lua script?</div><div><br></div><div>Using curl on the command line I can do the following:</div><div><br></div>

<div>
curl -H &quot;Content-Type: application/json&quot; -H &quot;Accept: application/json&quot; -X POST -d &#39;{&quot;field1&quot;:&quot;val1&quot;,&quot;field2&quot;:&quot;val2&quot;}&#39; <a href="http://mydomain.com/" target="_blank">http://mydomain.com/</a></div>


<div><br></div><div>And in a Lua script I can do the following:</div><div><br></div><div>local my_json = &quot;{\&quot;field1\&quot;:\&quot;val1\&quot;,\&quot;field2\&quot;:\&quot;val2\&quot;}&quot;</div><div>api = freeswitch.API()</div>


<div>response_data = api:execute(&quot;curl&quot;, &quot;<a href="http://mydomain.com/" target="_blank">http://mydomain.com/</a> post&quot; ..  my_json)</div><div><br></div><div>But I don&#39;t see a way in the freeswitch API to set the Content-Type header in the above script.</div>


<div><br></div><div>Appreciate any help or insight that can be offered.</div><div><br></div><div>Thanks.</div><span><font color="#888888"><div><br></div><div>Jeff </div></font></span></div>
</blockquote></div><br></div>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>