0

My endpoint is decorated like

[HttpGet("{data}")]
public async Task<MyObj> Get([FromQuery]List<string> data)

And I call this via

https:.........../api/Learning/one,other,hello

My data list is empty and I do not understand what I need to change.

I assume I can pass a string array as a parameter to an HttpGet endpoint?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
MyDaftQuestions
  • 4,487
  • 17
  • 63
  • 120
  • 1
    See the marked duplicate. The answer is the same whether you use a string or you use an integer. – Igor Aug 15 '23 at 16:13
  • 1) `FromQuery` reads from the query string - You need `FromRoute` 2) I think you'll have to split the string yourself – Pieterjan Aug 15 '23 at 16:14

0 Answers0