Handling responses from PHP's cURL

Wojtek on cURL, PHP, response · · Comments · 1 min read

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 »