We tried to use the CURL fn to POST json, but it's sent as form data and there seems no support for changing the Content-Type header. We switched to invoking curl in the shell. All the documentation I could find says there is just one parameter for the url and an optional second for POST body. Is there an undocumented way to set Content-Type? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20181005/c7370339/attachment.html>
Hi David, Have you tried CURLOPT function. i.e Set(CURLOPT(header)=Content-Type: application/json) Regards Nasir Iqbal ICTBroadcast - an Auto Dialer software for ITSP <https://www.ictbroadcast.com/how-become-internet-telephony-service-provider-itsp-using-ictbroadcast-sp-edition> SMS, Fax and Voice broadcasting & Inbound / Outbound Campaigns http://www.ictbroadcast.com/ On Fri, Oct 5, 2018 at 1:59 AM David P <davidswalkabout at gmail.com> wrote:> We tried to use the CURL fn to POST json, but it's sent as form data and > there seems no support for changing the Content-Type header. We switched to > invoking curl in the shell. > > All the documentation I could find says there is just one parameter for > the url and an optional second for POST body. Is there an undocumented way > to set Content-Type? > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Astricon is coming up October 9-11! Signup is available at: > https://www.asterisk.org/community/astricon-user-conference > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20181005/cdbe44cc/attachment.html>
My mistake, CURLOPT(header) is only to retrieve headers, not to sent. sorry. Nasir Iqbal ICTBroadcast - an Auto Dialer software for ITSP <https://www.ictbroadcast.com/how-become-internet-telephony-service-provider-itsp-using-ictbroadcast-sp-edition> SMS, Fax and Voice broadcasting & Inbound / Outbound Campaigns http://www.ictbroadcast.com/ On Fri, Oct 5, 2018 at 8:53 AM Nasir Iqbal <nasir at ictinnovations.com> wrote:> Hi David, > > Have you tried CURLOPT function. > i.e > Set(CURLOPT(header)=Content-Type: application/json) > > Regards > > Nasir Iqbal > > ICTBroadcast - an Auto Dialer software for ITSP > <https://www.ictbroadcast.com/how-become-internet-telephony-service-provider-itsp-using-ictbroadcast-sp-edition> > SMS, Fax and Voice broadcasting & Inbound / Outbound Campaigns > http://www.ictbroadcast.com/ > > > On Fri, Oct 5, 2018 at 1:59 AM David P <davidswalkabout at gmail.com> wrote: > >> We tried to use the CURL fn to POST json, but it's sent as form data and >> there seems no support for changing the Content-Type header. We switched to >> invoking curl in the shell. >> >> All the documentation I could find says there is just one parameter for >> the url and an optional second for POST body. Is there an undocumented way >> to set Content-Type? >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> Astricon is coming up October 9-11! Signup is available at: >> https://www.asterisk.org/community/astricon-user-conference >> >> Check out the new Asterisk community forum at: >> https://community.asterisk.org/ >> >> New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20181005/dc9f7ee2/attachment-0001.html>
Thanks, Nasir, I'll see if that allows us to avoid SHELL. On Fri, 5 Oct 2018, 4:53 pm Nasir Iqbal, <nasir at ictinnovations.com> wrote:> Hi David, > > Have you tried CURLOPT function. > i.e > Set(CURLOPT(header)=Content-Type: application/json) > > Regards > > Nasir Iqbal > > ICTBroadcast - an Auto Dialer software for ITSP > <https://www.ictbroadcast.com/how-become-internet-telephony-service-provider-itsp-using-ictbroadcast-sp-edition> > SMS, Fax and Voice broadcasting & Inbound / Outbound Campaigns > http://www.ictbroadcast.com/ > > > On Fri, Oct 5, 2018 at 1:59 AM David P <davidswalkabout at gmail.com> wrote: > >> We tried to use the CURL fn to POST json, but it's sent as form data and >> there seems no support for changing the Content-Type header. We switched to >> invoking curl in the shell. >> >> All the documentation I could find says there is just one parameter for >> the url and an optional second for POST body. Is there an undocumented way >> to set Content-Type? >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> Astricon is coming up October 9-11! Signup is available at: >> https://www.asterisk.org/community/astricon-user-conference >> >> Check out the new Asterisk community forum at: >> https://community.asterisk.org/ >> >> New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Astricon is coming up October 9-11! Signup is available at: > https://www.asterisk.org/community/astricon-user-conference > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20181007/a9e74290/attachment.html>