title: Hitting the http get request for linkedin giving error in angular 2
body: <p>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 directly in browser, it takes me to the signin page correctly. What would be the problem hitting the request?</p>
  
  <p>CORS issue resolved:</p>
  
  <p>I found localhost:4200 does not had '/' and after including it , CORS error was resolved , but hitting my http.get is having a problem
  component:</p>
  
  <pre><code>  import { Injectable } from '@angular/core';
      import {Http} from '@angular/http';
      import {Observable} from 'rxjs';
      import {map} from 'rxjs/operators'
      import { mapToExpression } from '../../../node_modules/@angular/compiler/src/render3/view/util';
      @Injectable({
        providedIn: 'root'
      })
      export class LinkedInService {
  
        constructor(private http:Http) {
          console.log("In Linked in constructor");
         }
  
         public linkedInSignIn(){
            console.log ("Linked in Sign in");
            let authURL ="https://www.linkedin.com/oauth/v2/authorization?"+// "https://www.linkedin.com/uas/oauth2/authorization?"+
            "response_type=code"+
            "&amp;client_id=781872"+
            "&amp;state=xys"+
            "&amp;redirect_uri=http://localhost:4200/";
            console.log("auth rul" +authURL);
            this.http.get(authURL).pipe(map(res =&gt; res.json()))
            .subscribe((res:Response)=&gt;{
              console.log("Http Get " + res);
            });//people =&gt; this.people = people);
         }    
  
        public linkedInSignOut(){
  
         }
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mye3j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mye3j.png" alt="enter image description here"></a></p>