1

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?

2
  • 1
    See the marked duplicate. The answer is the same whether you use a string or you use an integer. Commented Aug 15, 2023 at 16:13
  • 1
    1) FromQuery reads from the query string - You need FromRoute 2) I think you'll have to split the string yourself Commented Aug 15, 2023 at 16:14

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.