cURL on freebsd
am 31.03.2010 04:36:21 von Shane Hill--0016363b7fa697dc1204830f9c54
Content-Type: text/plain; charset=ISO-8859-1
can anyone tell me why the cURL code below produces a POST request as
expected on linux, but the same code on freebsd is forced to be a GET
request?
the linux box is running php 5.2.11
the freebsd box is running 5.3.2
is there a bug in 5.3.2? a search does not turn anything up.
=============================
function makePostRequest( $url , $params ) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$headers = array(
'Content-type: application/json',
'Expect:'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_UPLOAD, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$content = curl_exec($ch);
$errorCode = (int)curl_getinfo($ch,
CURLINFO_HTTP_CODE);
return array("content" => $content, "errorCode" =>
$errorCode);
}
--0016363b7fa697dc1204830f9c54--