I am sending a JSON object via AJAX and Web Api to my server:
var data = [ ["fdsfsd", "Kifdsfa", "fsdfsa", "fadsf", "fasdfsd", "fadsf", "fasdfsd"], ["2008", "-5", "11", "12", "13"], ["2009", "20", "-11", "14", "13"], ["2010", "30", "15", "-12", "readOnly"] ]; $.ajax({ url: '../webapi/Products', type: 'POST', dataType: "text", data: "="+JSON.stringify( data ), success: function (test) { alert(test); }, error: function (test) { alert("Error"); }
so I get on the server a value that I want to parse using JSON.NET:
public void Post([FromBody]string value ) { JObject o = JObject.Parse(@value); }
This throws an exception:
Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path '', line 1, position 1.
Why? It seems to me that this value is for me?