How to pass url arguments (query string) to a HTTP request as
let params: URLSearchParams = new URLSearchParams();
params.set('pageId', 0);
params.set('activeFilter', 1);
let requestOptions = new RequestOptions();
requestOptions.search = params;
return this._http.get("http://testsite.com/cats/page/", requestOptions ).map(res => res.json());
where in my requestOptions reference i want to pass like :pageId/:activeFilter .
finally i need to build an url to call my rest api server using this url ( http://testsite.com/cats/page/:pageId/:activeFilter ) //pageId=0,activeFilter=1
i have to bind only the value not the whole string?
i tried a lot. but it is not coming as i expected, this is what i am getting /cats/page/?pageId=0&activeFilter=1 in my server console.
any suggestions please? unable to find where i am going wrong
/cats/page/?pageId=0&activeFilter=1seems correct. What else should it be?http://testsite.com/cats/page/0/1? If so then just construct the URL. With string template if necessary.