What are these php Curl response headers indicative of? -
i trying use curl communicate api of server:
$ch = curl_init(); curl_setopt($ch, curlopt_url, 'pilot-payflowpro.paypal.com'); curl_setopt($ch, curlopt_httpheader, $headers); curl_setopt($ch, curlopt_useragent, $user_agent); curl_setopt($ch, curlopt_header, 1); // tells curl include headers in response curl_setopt($ch, curlopt_returntransfer, 1); // return variable curl_setopt($ch, curlopt_timeout, 45); // times out after 45 secs curl_setopt($ch, curlopt_followlocation, 0); curl_setopt($ch, curlopt_ssl_verifypeer, 0); // line makes work under https curl_setopt($ch, curlopt_postfields, $plist); //adding post data curl_setopt($ch, curlopt_ssl_verifyhost, 2); //verifies ssl certificate curl_setopt($ch, curlopt_forbid_reuse, true); //forces closure of connection when done curl_setopt($ch, curlopt_post, 1); //data sent post $result = curl_exec($ch); $headers = curl_getinfo($ch); print_r($headers);
however, $result variable empty, returntransfer set 1, means no response given. printing out headers gives:
( [url] => http://pilot-payflowpro.paypal.com [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 1.656 [namelookup_time] => 0.062 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [certinfo] => array ( ) )
what suggest in terms of debugging? using wamp on local desktop curl enabled.
thanks.
seems curlopt_url param wrong... try filled url (http://pilot-payflowpro.paypal.com)
in example, curl doesn't know protocol use (http, https)
edit : try https://pilot-payflowpro.paypal.com
since server mention doesn't respond on http protocol
Comments
Post a Comment