I'm sure I did it in another solution, but I can't find a solution to do it again, and wondered if anyone could help me ...
This is my WebAPI code:
public class WebController : ApiController { public void Get(string telephone, string postcode, List<Client> clients) { } }
And by calling this from jQuery:
function Client(name, age) { this.Name = name; this.Age = age; } var Clients = []; Clients.push(new Client("Chris", 27)); $.ajax({ url: "/api/Web/", data: { telephone: "999", postcode: "xxx xxx", clients: Clients } });
But the clients object always returns as null. I also tried JSON.stringify(Clients) and this is the same result. Can someone see something obvious, I'm missing here?
source share