0
我已驗證$requestDom->saveXml()
正在返回有效的XML,但在目標URL處有print_r($ _ POST),並且它不會收到任何內容。我在這裏錯過了什麼嗎? : - \Curl POST字段未發佈
$connection = curl_init();
curl_setopt($connection, CURLOPT_POSTFIELDS, array(
'xml' => $requestDom->saveXml()
));
curl_setopt($connection, CURLOPT_HEADER, false); //with or without this option, it doesn't work
curl_setopt($connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($connection, CURLOPT_POST, true);
curl_setopt($connection, CURLOPT_URL, 'http://sample.com');
$response = curl_exec($connection);