curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); if ($customHeader) { curl_setopt($ch, CURLOPT_HTTPHEADER, $customHeader); } //Test if ssl use is required if (strncasecmp($url, "https", 5) === 0) { curl_setopt($ch, CURLOPT_SSLVERSION, 3); // Force use of SSL version 3 // SSL options curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); // Prodution server should have 2 value. 1 just checks common name curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, False); // Validates the server certificate against the CA } $output = curl_exec($ch); if (!$output && $errors) { return array('errors' => curl_error($ch), 'response' => $output); } return $output; } if (!isset($_GET['feed'])) { $response = new ResponseWithError(); $response->setFeed(new stdClass()); $response->setError("No object set"); echo json_encode($response); return; } else { $services = new WebService(); $services->requestGoogleApi(); }