PHP https post XML data with cURL

前端 未结 3 833
刺人心
刺人心 2021-01-01 01:49

I\'m trying to send a HTTPS POST request with XML data to a server using PHP.

Anything sends to the server requires authentication therefore I\'ll use cURL.

3条回答
  •  难免孤独
    2021-01-01 01:58

    You have to do, in you original code:

    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $fields['data']);
    

    or

    curl_setopt($ch, CURLOPT_POSTFIELDS, 'AAAAhttp://192.168.11.30:8080/xxx.htmlAAAA_descHTML');
    

    I mean that you have to send the XML directly.

提交回复
热议问题