I am trying to send an array of items, whether that's a model[] of varying types or a string[]. From what I've looked at so far it doesn't seem possible, although we send arrays of models to the API controllers already using AJAX calls, this however needs to be sent from an App.
Currently I am sending one at a time to the server, I have tried using the [HtmlPost] tag as well as sending things via List, item[] and serialised as a string object (winds up too large easily).
//App Code
var data = MyListOfModels[];
var result = api.APIController.MyMethod(data);
//API Code
[Route("API/APIController/MyMethod")]
public bool MyMethod(Model[] modelList)
{
return service.DoSomethingWithModels(ModelList);
}
I'm expecting to be able to send an array to the method which can do something with that array of data.
The connections between the web API and Xamarin are built using Swagger.