Hitting the http get request for linkedin giving error in angular 2

后端 未结 1 2008
时光取名叫无心
时光取名叫无心 2021-01-22 03:37

I am doing signup with linkedin and need to fetch access code and basic profile details. But when I post the request, I am getting CORS error in my console, when I hit the URL d

相关标签:
1条回答
  • EDIT :

    You need not require to map your response object from http.get(). It is automatically done by new angular6 http.

    So it should be this way :

    this.http.get(authURL).subscribe((res:any)=> {console.log("Http Get " + res); });

    Original answer related to CORS :

    As suggested in that answer, try to invoke linkedIn api from your backend api and not from the browser directly. This will solve your Cross origin related problem.

    Linkedin will directly not allow any third application to execute its api. It has to be from your backend api itself and not the browser.

    0 讨论(0)
提交回复
热议问题