CURL and basic authentification
| From: | Diana Castillo | Date: | Tue, 04 May 2004 15:05:35 +0000 |
| Subject: | CURL and basic authentification | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-185313@lists.php.net to get a copy of this message | ||
Hi, I need to know why when I send petition with CURL like this, the machine
I am sending to approves my authorization, but gets an empty request. What
can I do to debug this?
function getResponse($request, $type){
$curl_interface = curl_init();
curl_setopt($curl_interface, CURLOPT_HTTPHEADER,array("Authorization:
Basic " . base64_encode(AZOR_USR . ":" . AZOR_PASSWORD)));
curl_setopt($curl_interface, CURLOPT_URL,AZOR_URL);
curl_setopt($curl_interface, CURLOPT_POST, 1);
curl_setopt($curl_interface, CURLOPT_POSTFIELDS,$request);
curl_setopt ($curl_interface, CURLOPT_RETURNTRANSFER, 1);
$xml_response=curl_exec ($curl_interface);
curl_close ($curl_interface);
return $xml_response;
}
--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039
Fax : 00-34-915228673
email: diana@hotelkey.com
Web : http://www.hotelkey.com
http://www.destinia.com