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