I'm getting a 500 (Internal Server Error)
when I try to run
$.ajax({
xhr: function() {
var xhr = new window.XMLHttpRequest();
return xhr;
},
type: 'POST',
url: '@Url.Action("MyAction","MyController")',
data: fi,
contentType: "application/json; charset=utf-8",
dataType: "json", // dataType is json format
success: function(retJson) {
// ...
}
});
where fi
is a JavaScript map like {org: "string1", cat: "string2", fileName: "string3"}
, and myAction
is like
[HttpPost]
public async Task<JsonResult> myAction (FileInfo fi)
{
where FileInfo
is defined by
public class FileInfo
{
public string org { get; set; }
public string cat { get; set; }
public string fileName { get; set; }
}
Any idea what I'm missing here?