Angular http client with query parameters example

1 · Adrian Matei · Sept. 8, 2021, 8:48 a.m.
In Codever we use extensively the Angular Http Client to make REST calls against a NodeJs/ExpressJS API - source code on Github. In the following snippet you can see hot to set http query parameters to the rest api calls. Use the HttpParams class with the params request option to add URL query strings in your HttpRequest: getFilteredPersonalBookmarks(searchText: string, limit: number, page: number, userId: string, include: string): Observable<Bookmark[]> { const params = new HttpParams() ...