So, I am trying to migrate from 'old' http to the new httpClient
with the http client I am using this format in my service:
return this.http.get(environment.api+ '.feed.json', requestOptions)
how do I use this in httpClient?
tried many thiungs... including
return this.http.get(environment.api+ '.feed.json', {params: requestOptions.params})
but getting a type missmatch :(
Try this:
const requestOptions = {
params: new HttpParams()
};
requestOptions.params.set('foo', 'bar');
this.http.get(environment.api+ '.feed.json', requestOptions );
Here is also the link to the docs describing how to do that with examples for headers and URL Parameters: HttpClient