apache - HTTP/1.1 505 HTTP Version Not Supported php curl -
apache - HTTP/1.1 505 HTTP Version Not Supported php curl -
i attempting implement paypal's future payment server (https://github.com/paypal/paypal-ios-sdk/blob/master/docs/future_payments_server.md), running issue server platform.
whenever seek curl code:
$headers = array( 'content-type: application/x-www-form-urlencoded' ); $userpwd = "client_id:secret"; $ch = curl_init("https://api.paypal.com/v1/oauth2/token?grant_type=authorization_code&response_type=token&redirect_uri=urn:ietf:wg:oauth:2.0:oob&code=".$code); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_header, $headers); curl_setopt($ch, curlopt_userpwd, $userpwd); $response = curl_exec($ch); curl_close($ch);
i next response:
http/1.1 505 http version not supported server: apache-coyote/1.1 date: wed, 22 oct 2014 21:30:35 gmt connection: close
what causing issue, , how configure server back upwards curl code?
thanks
update: new code
$headers = array( 'content-type: application/x-www-form-urlencoded' ); $fp = fopen("db.txt","w"); $data = array( "grant_type" => "authorization_code", "response_type" => "token", "redirect_uri" => "urn:ietf:wg:oauth:2.0:oob", "code" => $code ); $query = http_build_query($data); $ch = curl_init("https://api.paypal.com/v1/oauth2/token?".$query); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_header, $headers); curl_setopt($ch, curlopt_userpwd, $userpwd); curl_setopt($ch, curlopt_http_version, curl_http_version_none); $response = curl_exec($ch); curl_close($ch); fwrite($fp,$response); fclose($fp);
new error message:
http/1.1 500 internal server error server: apache-coyote/1.1 proxy_server_info: host=slcjavapapi3027a.slc.paypal.com;threadid=xxxx paypal-debug-id: 679a3452b9bad pragma: no-cache cache-control: no-cache expires: wed, 31 dec 1969 16:00:00 pst server_info: identitysecuretokenserv:v1.oauth2.token&calthreadid=xxxxx&topleveltxnstarttime=149489a7468&host=slcidensectoken3043a.slc.paypal.com&pid=xxxxx content-language: * date: sat, 25 oct 2014 18:38:41 gmt connection: close content-type: text/xml content-length: 0 connection: close
php apache http curl paypal
Comments
Post a Comment