Hi folks,

I'm trying to send an XML request to a server to get its response 
back... I can get it to work on the command line (with passthru) but 
not with libcurl. I'm using libcurl 7.9.2 which may actually be 
different from the curl on the command line... the latter came with 
OS X, the former came from entropy.ch with the PHP package I 
installed. Of course my host is using 7.9.4 and the script doesn't 
work there either.

I've tried it with both GET and POST... here are some setup variables.

$testrequest = "$server?API=Rate&XML=<RateRequest USERID=\"$userid\" 

$post['XML']= "'<RateRequest USERID=\"$userid\" 

# (I've tried it with the 's and without, with the \n's and without)

$d1 = "API=Rate";
$d2 = "XML='<RateRequest USERID=\"$userid\" 

$ch = curl_init();

# doesn't work, returns Error 400
curl_setopt($ch, CURLOPT_URL, $testrequest);

# also doesn't work, returns BAD REQUEST
curl_setopt($ch, CURLOPT_URL, $server);

# what DOES work
passthru("curl -d " . $d1 . " -d " . $d2 . " $server");

Any ideas?


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to