Forum Moderators: coopster
$xml_data = <<<ENDOFXML
<?xml version="1.0" encoding="UTF-8"?>
<TempList><Credentials username="$user" password="$pw" remoteIp="$remoteip"/><Country>$country</Country><City>$city</City></TempList>
ENDOFXML;
$url = "http://www.example.com/example/example.do?xml=";
Do you mean to remove the quote marks around the Credentials data?
$xml_data = '....username='.$user.' pass....';
....username=eg pass....
....username="eg" pass....
$xml_data = <<<ENDOFXML# What exactly do you mean?
My URL+xml request works when I put it in the browser address bar. But when I try and make the same request with cURL then the XML API returns an Error
but I still get an error response from the API ..... for requests that work correctly when I put them in the address bar. Is there something obvious I am missing here does anybody know.
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'xml='.$xml_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded'));