I have a JSON line like this:
'{"1":[1,3,5],"2":[2,5,6],"3":[5,6,8]}'
I want to send it to Web Api Controller without modification using an ajax request:
$.ajax({
type: "POST",
url: "Api/Serialize/Dict",
data: JSON.stringify(sendedData),
dataType: "json"
});
In Web Api, I have a method like this:
[HttpPost]
public object Dict(Dictionary<int, List<int>> sendedData)
{
return null;
}
And always sendedData == null.Other words: I don't know how to deserialize JSON into (Dictionary<int, List<int>>.
Thanks for the answer.
source
share