problem with asp.net mvc web api get call
problem with asp.net mvc web api get call
This is my code in the doc ready function:
$("#queue").dataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "/api/FooBarQueue",
"dataSrc": "",
}
});
This is an ajax call on a web api function that returns this data (an object array). When I look in Fiddler, the call that is made results in a 404 because of a very long query string (even though the url is /api/FooBarQueue with nothing appended. Lots of query params such as draw=1&columns%5B0%5D.......
I used "dataSrc": "" based on a forum reply of a user with similar problem and that worked for him.
The returned data:
"[{\"QueueID\":27,\"BCOrderNumber\":300524,\"OrderDate\":\"2015-02-16T16:39:05\",\"SKU\":\"3DOV-FP-GP-094\",\"MaterialID\":0,\"Quantity\":1,\"OriginalFileName\":\"blahblah.jpg\",\"Initials\":\"\",\"ModelFileName\":\"\",\"MD5\":\"\",\"CreateDate\":\"2015-03-01T18:29:08.627\"},{\"QueueID\":28,\"BCOrderNumber\":300524,\"OrderDate\":\"2015-02-16T16:39:05\",\"SKU\":\"XXDOX-XX-XX-094\",\"MaterialID\":0,\"Quantity\":1,\"OriginalFileName\":\"xxxxCrest.jpg\",\"Initials\":\"\",\"ModelFileName\":\"\",\"MD5\":\"\",\"CreateDate\":\"2015-03-03T12:23:56.297\"}]"