php - cURL call to web service not working -
i trying make simple call .net restful web service @ https://salesgenie.com/brandingservice/details?url=att.salesgenie.com test page making curl call @ https://test-cms.salesgenie.com/wp-content/themes/salesgenie/branding-proxy.php web service can called in browser timing out when called via curl. here code branding-proxy.php page:
if (!function_exists('curl_init')){ die('sorry curl not installed!'); } $url = 'https://salesgenie.com/brandingservice/details?url=att.salesgenie.com'; $handle = curl_init(); curl_setopt($handle, curlopt_url, $url); curl_setopt($handle, curlopt_returntransfer, true); curl_setopt($handle, curlopt_ssl_verifyhost, 2); curl_setopt($handle, curlopt_ssl_verifypeer, false); curl_setopt($handle, curlopt_sslversion,3); $response = curl_exec($handle); $code = curl_getinfo($handle, curlinfo_http_code); curl_close($handle); setcookie('cmscookie', $code . ' ' . $response, 0, '/', 'salesgenie.com', 0); echo 'code:' . $code."<br />response: ".$response;
i can see timeout happens while using links, though think problem happens somewhere else. reason i've come conclusion uploaded code own website. worked fine.
important
if owner of salesgenie.com
think have problem server, since responses got either timeout (code 0), code 200 (with result) or code 320. problem might problem within server itself.
tricks
- try removing
setcookie
spare processing. - also try using
http
instead ofhttps
sincehttps
requires more processing use.
Comments
Post a Comment