Authorization Angular Token 2

0
Good afternoon. I'm having trouble sending a token in the GET request using Angular. I'm sending the token string straight into the header, and in the backend it comes as null. My api already has the necessary headers to avoid cors problems, the problem is that the token is not reaching me.

The code that does the request follows, I'm using HttpClient and JWT:

getIdeias(): Observable<Ideia[]>{
      const headers = new HttpHeaders({
        'Content-Type':  'application/json',
        'Authorization': 'eyJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE1MjYzOTY1MjUsInN1YiI6ImdnQGdnLmNvbSJ9.bgIpmQTA5505aGIEaaIdtLe3EjDUGjL8zkBJRG8w9VTIIyuWkbKvTbvCm8fVSGgXc0VCa5_Pop2qGxb7hVyqWQ'
        });

      return this.http.get<Ideia[]>(this.url,{headers})
        .map(res => res);
    }

    
asked by anonymous 19.05.2018 / 22:08

0 answers