I am using "@angular/common": "^6.0.7", and the documentation says that a httclient.request can either take in a string or HttpRequest. Yet when I pass in HttpRequest i get error TS2345: Argument of type 'HttpRequest<{ reportProgress: boolean; observe: string; }>' is not assignable to parameter of type 'string'.
Below is the code.
const req = new HttpRequest('GET', url, {
reportProgress: true,
observe: 'response'
});
return this.http.request(
req, url, {
observe: 'response'
}).pipe(
retry(3),
catchError(this.handleError));
Thanks.
Solution
Look at the function used. In my case
return this.http.request(
req.pipe(
retry(3),
catchError(this.handleError));
url
from the return statement.return this.http.request(req, {observe: 'response'})...
– Jason White