Handling responses from PHP's cURL
Recently I had a small problem with cURL. The request was supposed to return only JSON data to use in my app. I wrote the following: $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://somedomain.com/api/123'); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_exec($curl); $status... Read more »