5 && strtolower(substr($url,0,5)) == "https" ) { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); } if (is_array($headers) && 0 < count($headers)) { $httpHeaders =self::getHttpHearders($headers); curl_setopt($ch,CURLOPT_HTTPHEADER,$httpHeaders); } $httpResponse = new HttpResponse(); $httpResponse->setBody(curl_exec($ch)); $httpResponse->setStatus(curl_getinfo($ch, CURLINFO_HTTP_CODE)); if (curl_errno($ch)) { throw new ClientException("Speicified endpoint or uri is not valid.", "SDK.ServerUnreachable"); } curl_close($ch); return $httpResponse; } static function getHttpHearders($headers) { $httpHeader = array(); foreach ($headers as $key => $value) { array_push($httpHeader, $key.":".$value); } return $httpHeader; } }