HttpGet API Endpoint Accepting Array Parameter
I have an endpoint for an HttpGet method:
Is it best practice to use
[FromQuery]
and accept the values as part of the URI? If so, what's the best way to build this request URI for my HttpClient? Do I need to manually concatenate a string, e.g. 'https://localhost:7109/api/Predictions/fightIds?fightIds=1&fightIds=2'
?
This feels like I'm doing something that is bad practice here. Or should my endpoint be accepting [FromBody]
or some other way?2 Replies