When my Angular 6 app makes a request to the ASP.NET Core web API using the GET method, I want to send a list or array of unique identifiers as parameters. In return, I expect only information relevant to those identifiers to be retrieved from the API.
Here is a snippet of my web API code:
[HttpGet]
public ActionResult GetByGuids(List<Guid> Guids)
{
// Implement some logic here...
return Ok(_someService.someAction(Guids));
// Pass the Guids as a parameter to the service layer function
}
Based on my research, it seems that I cannot include the array of unique identifiers in the body of the request, as it is a GET method.
The use of [FromQuery] is necessary to prevent errors when dealing with array or list parameters, but I am unsure how to write the corresponding Angular code if this is the only solution.
I would greatly appreciate any assistance or guidance on this matter.
Thank you in advance for your help.