I am passing a Javascript array of a collection of strings to a post action on my apicontroller, there is a data being sent ( i know this via fiddler ) but it doesn't seem to actually get to the controller action when i am debugging the code. My code is below, any help would be greatly appreciated.
Edit: Just to clarify, the controller action is called but the List stuffsId has a count of zero when there is a list being passed to it
Ajax/Javascript
my.sendStuffToController = function (stuffIds, completedHandler) {
$.ajax({
dataType: 'json',
type: 'POST',
url: my.stuffUrl,
data: {
stuffIds: stuffIds
},
success: function (data) {
if (completedHandler !== undefined) {
completedHandler(stuffIds);
}
}
});
};
My ApiController Post Action
// Post
public void PostAsync(List<string> stuffIds)
{
var clientProxy = this.proxyFactory.CreateClientProxy(Tokens.EndPoint);
var clientChannel = clientProxy.GetClientChannel();
try
{
clientChannel.DoStuffAsync(stuffIds);
}
finally
{
clientProxy.TryCloseAbortClientChannel();
}
}