Here is my ajax call:
var myIds = ["A","B","C"]
$.ajax({
type: "POST",
url: /DoStuffAndThings?year=2018&name=test,
data: {myIds: myIds},
traditional: false
});
Here is my controller action:
[HttpPost]
public void DoStuffAndThings(int year, string name, [FromBody] List<string> myIds) {
// do stuff
}
year and name come through without issue but myIds is always empty.
Ive tried
data: {myIds: myIds} and data: myIds and data: {"": myIds} and I tried using Ienumerable<string> and List<string> and string[]
and I've tried traditional: true and false