Angela P
Angela P
Jul 28, 2017 · 1 min read

Hi, when I try to switch Http with HttpClient in the constructor, I realized that the HttpClient cant take RequestOptions as a parameter. I can’t find documentation on this. Do you know where I should look?

Part of my code:

let requestOptions = new RequestOptions();
requestOptions.search = params; //params is of type URLSearchParams

this.http.get(AppSettings.API_ENDPOINT, requestOptions ).map(res => res.json()).share();

Error:

Argument of type ‘RequestOptions’ is not assignable to parameter of type ‘{headers?: HTtpHeaders; observe?:”body”; ….

    Angela P

    Written by

    Angela P

    Until you appreciate what you currently have, more won’t make your life better. Intagram: @ernie_nyc_tabby website: angelapannyc.com