[Freeswitch-users] mod_curl setting content type header
Jeff Stark
jstark888 at gmail.com
Thu May 29 06:49:32 MSD 2014
Hi,
Is there a way to set the Content-Type header when using mod_curl in a Lua
script?
Using curl on the command line I can do the following:
curl -H "Content-Type: application/json" -H "Accept: application/json" -X
POST -d '{"field1":"val1","field2":"val2"}' http://mydomain.com/
And in a Lua script I can do the following:
local my_json = "{\"field1\":\"val1\",\"field2\":\"val2\"}"
api = freeswitch.API()
response_data = api:execute("curl", "http://mydomain.com/ post" .. my_json)
But I don't see a way in the freeswitch API to set the Content-Type header
in the above script.
Appreciate any help or insight that can be offered.
Thanks.
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140528/6fc0defa/attachment-0001.html
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list