[asterisk-bugs] [JIRA] (ASTERISK-28613) func_curl: CURLOPT cannot set Content-Type header

Thomas Guebels (JIRA) noreply at issues.asterisk.org
Thu Nov 21 08:27:32 CST 2019


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=248812#comment-248812 ] 

Thomas Guebels commented on ASTERISK-28613:
-------------------------------------------

@matesstar 

Hi Martin,

Looking at the patch it appears you can only add headers, not edit or remove them. This means that if you set the Content-Type for a first HTTP request, every following request on the same channel will have to use the same Content-Type. If you set it again you will end up with duplicate Content-Type headers on the next request. Isn't that a serious limitation ?

Actually, we tried to implement it the same way as you but hit that limitation which made it impractical for us. We are now working on an implementation where you can pass a dialplan hash containing multiple "header: value" to set at once, replacing the previous headers.



> func_curl: CURLOPT cannot set Content-Type header
> -------------------------------------------------
>
>                 Key: ASTERISK-28613
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28613
>             Project: Asterisk
>          Issue Type: New Feature
>      Security Level: None
>          Components: Functions/func_curl
>    Affects Versions: 13.29.1
>            Reporter: Martin Tomec
>            Assignee: Martin Tomec
>            Severity: Minor
>
> For sending JSON requests, CURLOPT should be able to set Content-Type header. There is demand for it:
> https://asteriskfaqs.org/2018/10/04/asterisk-users/curl-to-post-applicationjson.html
> I have prepared patch for http headers parameter setting.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list