简体   繁体   English

如何从linkedin中的Access Token API获取AccessToken

[英]How can i get AccessToken from API of Access Token in linkedin

We are integrating LinkedIn login API, we are able to generate authorization code, also able to get access token from browser我们正在集成LinkedIn登录API,我们能够生成授权码,也能够从浏览器获取访问令牌

在此处输入图片说明

enter image description here but we want this in ajax or HTTP call It gives us 200 OK response but not returning the body, but it works in Postman在此处输入图像描述,但我们希望在 ajax 或 HTTP 调用中使用它它给了我们 200 OK 响应但不返回正文,但它在 Postman 中有效

Put your body into second params not concat body into your url 将您的身体放在第二个参数中,而不是将身体放在您​​的网址中

return this.httpClient.post<User>("yoururl", body);

If not working Try to use observe: 'response' to see if it work like this 如果不起作用,请尝试使用observe: 'response'以查看其是否像这样工作

return this.httpClient.post<User>("yoururl", body, {
      observe: 'response'
});

1) You need to pass body not as query param but as body object, here is the post call signature : 1)您需要传递主体而不是作为查询参数,而是作为主体对象,这是邮寄签名:

post(url: string, body: any | null, options: {
    headers?: HttpHeaders | {
        [header: string]: string | string[];
    };
    observe?: HttpObserve;
    params?: HttpParams | {
        [param: string]: string | string[];
    };
    reportProgress?: boolean;
    responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
    withCredentials?: boolean;
} = {}): Observable<any> 

Refer HttpClient 引用HttpClient

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM