How to pass an array within a query string in HttpClient?
According the interface you can do that like
const params = new HttpParams({
fromObject: { 'actors[]': ['Elvis', 'Jane', 'Frances'] }
});
this.http.get(url, { params });
I think the best way is to add them to parameters as a string
and have your back-end convert it back to an array
or list
.
let actorList = ['Elvis', 'Jane', 'Frances']
let params = new HttpParams();
params = params.append('actors', actorList.join(', '));
this.http.get(url, { params: params });