Hey there! I'm relatively new to Angular and I've hit a roadblock. I need to send an array as parameters to a backend API, which specifically expects an array of strings.
const params = new HttpParams();
const depKey = ['deploymentInprogress', 'deploymentMessage'];
params.append('depKey', JSON.stringify(depKey));
this.http.get(uri, { params: params })
.pipe(
take(1),
catchError((error) => {
return throwError(error);
})
).subscribe(data => {
})
The code snippet above didn't yield the desired outcome. I'm seeking assistance on how to properly pass an array of strings as parameters to our backend API.