在访问一些基本配置文件字段时,我发现RESTAPI中的likedin出现401 ssl必需错误

在访问一些基本配置文件字段时,我发现RESTAPI中的likedin出现401 ssl必需错误,api,rest,ssl,linkedin,user-profile,Api,Rest,Ssl,Linkedin,User Profile,我正在使用RESTAPI用php代码从linkedin获取基本的配置文件数据。我能够成功地生成访问代码和访问令牌,但每当我尝试使用以下url获取基本配置文件时,就会出现ssl必需错误 我按照上面列出的所有步骤发出经过身份验证的请求 我使用非ssl url作为回调参数,是否需要使用ssl url?如果不是,那么为什么我会得到这个错误。 寻找解决方案 下面是获取配置文件字段的代码 $host = "api.linkedin.com"; $path = "/v1/people/~)"; //$arr

我正在使用RESTAPI用php代码从linkedin获取基本的配置文件数据。我能够成功地生成访问代码和访问令牌,但每当我尝试使用以下url获取基本配置文件时,就会出现ssl必需错误

我按照上面列出的所有步骤发出经过身份验证的请求

我使用非ssl url作为回调参数,是否需要使用ssl url?如果不是,那么为什么我会得到这个错误。 寻找解决方案

下面是获取配置文件字段的代码

$host = "api.linkedin.com";
$path = "/v1/people/~)";
//$arr = array('oauth2_access_token' => $access['access_token']);
$token = $access['access_token'];

  $header[] = "Authorization: Bearer ".$token;
  $header[] = "Connection: keep-alive"; 
  $header[] = "Keep-Alive: 300";


$ch = curl_init();

// endpoint url
curl_setopt($ch, CURLOPT_URL, $host . $path);

// set request as regular post
//curl_setopt($ch, CURLOPT_HTTPGET, true);

// set http version
curl_setopt($ch, CURLOPT_HTTP_VERSION, 'HTTP/1.1');

// set data to be send
//curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($arr));

// set header
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

// set header
curl_setopt($ch, CURLOPT_CERTINFO, true);

// return transfer as string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

curl_close($ch);

var_export($response);

我的解决方案是使用https://而不仅仅是http://

我的解决方案是使用https://而不仅仅是http://