Ahhh! no more cURL, what do I do?
Posted: Wed Aug 26, 2009 10:50 pm
My hosting provider no longer offers curl support and that's all I've used before for the functionality I've needed.
In particular, I'm looking for an alternative to curl to make this function work...
private function GetQueryResponse($requestUrl, $postString) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $requestUrl);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
I've been looking at fopen and file_get_contents from what info I could find on the board here, but I'm in a time crunch and can't seem to wrap my head around how i might make an alternative function. Any help would be greatly appreciated.
In particular, I'm looking for an alternative to curl to make this function work...
private function GetQueryResponse($requestUrl, $postString) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $requestUrl);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
I've been looking at fopen and file_get_contents from what info I could find on the board here, but I'm in a time crunch and can't seem to wrap my head around how i might make an alternative function. Any help would be greatly appreciated.