this is my client side ajax call:
var list = [\"a\", \"b\", \"c\", \"d\"];
var jsonText = { data: list };
$.ajax({
type: \
use the method above to send array as suggested by cris in your jquery ajax call. JSON data is usually in key value pair.
var tmp = [];
tmp.push({
//this is the key name 'a' "a": "your value", //it could be anything here in
//string format.
"b": "b",
"c": "c",
"d": "d"
});
{ data: JSON.stringify(tmp);}
You can also accomplish above by using two dimensional array
Additionally do this in the webapi project.
under the models folder in your web api project create a class file. Possibly class1.cs.
Create 4 properties
public string a {get; set;}
public string b {get; set;}
public string c {get; set;}
public string d {get; set;}
Now do this in your controller
using projectname.models
[HttpPost]
public return-type actionname(List obj)
{
//Further logic goes here
}
I am sure this will work.