<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://<private IP>: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><div><br></div><div>Jeff</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, May 28, 2014 at 4:49 PM, Jeff Stark <span dir="ltr"><<a href="mailto:jstark888@gmail.com" target="_blank">jstark888@gmail.com</a>></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 "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"field1":"val1","field2":"val2"}' <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 = "{\"field1\":\"val1\",\"field2\":\"val2\"}"</div><div>api = freeswitch.API()</div>
<div>response_data = api:execute("curl", "<a href="http://mydomain.com/" target="_blank">http://mydomain.com/</a> post" .. my_json)</div><div><br></div><div>But I don'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 class="HOEnZb"><font color="#888888"><div><br></div><div>Jeff </div></font></span></div>
</blockquote></div><br></div>