curl-and-php
Slashes and quotes
Date: Tue, 6 Jul 2004 10:32:14 +0200
Hi all !
I'm making an application in Curl that sends XML using POST. The data
is received with the quotes backslashed :
$url="http://server.com/process.php"
$xmlstream='xml=<?xml version="1.0" encoding="UTF-8"?<test data="data_to_test"></test>';
curl_setopt($ch, CURLOPT_HTTPHEADER, array('POST HTTP/1.1', 'Accept: text/plain', 'Content-length:'.strlen($xmlstream)));
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$xmlstream);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_VERBOSE,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
The content of the $_POST["xml"] variable received is :
_POST["xml"] <?xml version=\"1.0\" encoding=\"UTF-8\"?><test data=\"data_to_test\"></test>
Instead of :
_POST["xml"] <?xml version="1.0" encoding="UTF-8"?><test data="data_to_test"></test>
Any idea ?
Best regards,
Antonio Navarro Navarro
hostmaster_at_bemarnet.es
BemarNet Management
http://www.bemarnet.es
Received on 2004-07-06