I have a C# backend HttpGet method which is accepting a dictionary like this as request parameters.
public async Task<IActionResult> Search([BindRequired, FromQuery] IDictionary<string, object> pairs)
My frontend is in Angular 8. What should I pass in the Angular service class get method when backend is accepting a dictionary like this? Is it a Query String or what?
currently i am passing a query string like this,
search(parameters: any): Observable<any> {
var queryString = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&');
return this.httpClient.get(environment.host + environment.search + queryString);
}
But it is not working. when i debug and see, the backend request parameter values are null even though i passed values from frontend.
Thank You!