get the value of an url response with curl

sandyoyster

New Member
I am using PHP curl method to get a string type response. To create the request I use:\[code\]$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_FAILONERROR, true);curl_setopt($ch, CURLOPT_POSTFIELDS, $data);curl_setopt($ch, CURLOPT_BINARYTRANSFER, $data);$response = curl_exec($ch);$err = curl_error($ch);curl_close($ch);if($response === false) throw new Exception(__CLASS__."::".__FUNCTION__."_".$err);return $response;\[/code\]Why I always receive a bool(true) response instead of the string I echo from the other side?Thanks
 
Back
Top