PHP cURL Content-Type is not set

后端 未结 1 1785
执笔经年
执笔经年 2021-02-05 03:02

I have a simple web service that I would like to connect with. In order to post some XML, which will be properly proceeded on the web service side, I need to prepar

相关标签:
1条回答
  • 2021-02-05 03:15

    You are setting HTTP_HEADER twice:

    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                                                'Content-Type: application/xml',
                                                'Connection: Keep-Alive'
                                                ));
    
    curl_setopt($ch, CURLOPT_HTTPHEADER,array("Expect:  "));
    

    I guess that is the problem. The second time you set it, you delete the first setting.

    0 讨论(0)
提交回复
热议问题