angular - 使用rest api来自linkedin的错误响应
问题描述
我正在尝试使用 rest API 方法实现登录 LinkedIn 功能。我从LinkedIn得到了access_token
& 。expires_in
我已经从中提取了 access_token 并传递给get
请求以获取配置文件详细信息。但我没有得到任何回应。这是我的代码。
gettheLinkedinUserDetails(token: any) {
alert(token);
let headers = new HttpHeaders();
//headers.append('Content-Type', 'application/x-www-form-urlencoded');
headers.append('Authorization','Bearer '+token);
return this.http.get('https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url)?format=json',{headers: headers})
}
&
this.lkPage.gettheLinkedinUserDetails(result)
.subscribe((profileData: any) => {
alert(profileData + 'profile');
},(err) => {
alert(err + 'error');
})
& 在响应中,我得到的错误是
{"headers":{"nomalizedNames":{},"lazyUpdate":null},"status":401,"stsusText":"OK","url":"https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url?format=json"
","ok":false,"name":"httpErrorResponse""message":"Http failure response forhttps://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url)?format=json;401 OK","error
":{"errorCode":0,"message":"Unknown authentication schema","requestId":"B6AFJPFBMX","status":401
"timestamp":1535978521964}}
解决方案
推荐阅读
- html - 元素的边框底部在水平容器内被切断
- javascript - append().ready() 导致多个代码事件 | jQuery
- pine-script - 在 pine 脚本中计算 beta:我做错了什么?
- flutter - onTap 不断被呼叫
- scala - RDD[Double] 问题 - 尝试在 Spark Scala 中的 GroupBy 之后调用函数
- flutter - 如何从头开始创建我自己的自定义 RMTP 服务器并流式传输到多个目的地
- c# - rabbitmq频道应该留给消费者吗?
- javascript - “未定义”类型上不存在属性“句柄”-反应上下文和打字稿
- python - 函数恰好需要 2 个参数 3(给定)python cx_orcale 插入错误
- angular - 类型错误:“xxx”不是函数