I am trying to make multiple params value for single value in Angular get request, but it returning array for the value here is my code.
let params = new HttpParams;
let prefectures = [01, 02] //dynamic array of numbers
for(let pre of prefectures){
params = params.append('prefecturesCode', pre);
}
here is the request code
return this.http
.get(this.replaceBaseUrl(url), {
headers,
params: params
})
I am getting this url
http://localhost:3003/endpoint?prefecturesCode=02,03
But what I need is like this
http://localhost:3003/endpoint?prefecturesCode=02&prefecturesCode=03
What I am doing wrong?