Currently facing an issue with tslint and seeking guidance in the right direction.
Attempting to make an HTTP GET request using Angular2's HTTP service. This request requires specifying the content-type and bearer authentication token.
Snippet of my code:
let headers = new Headers();
let authToken = this._user.getUser().JWT;
headers.append('Content-Type', 'application/json');
headers.append('Authorization', `Bearer ${authToken}`);
let options = new RequestOptions({ headers: headers });
this._http.get('http://' + url '/', options)
.timeout(3000)
.subscribe(
(res) => {
The functionality works fine, but tslint raises a complaint that
"TS2345: Argument of type '{ headers: Headers; }' is not assignable to parameter of type 'RequestOptionsArgs'. Types of property 'headers' are incompatible. Type 'Headers' is not assignable to type 'Headers'. Two different types with this name exist, but they are unrelated. Property 'keys' is missing in type 'Headers'."
Your assistance will be highly appreciated.