<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/">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/">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><div><br></div><div>Jeff </div></div>