I am trying to post a simple JSON to C# Controller but I am getting null. I am new to AngularJS.
here is the angularjs code that posts
k = "{ 'id': 1,'name': 'A green door','price': 12.50}";
$http.post("/Inventory/PostSO", k)
.then(function (response) {
$scope.message = response.status;
},
function (error, status) {
$scope.message = error.error;
});
this is the C# code but string data is always null
public ContentResult PostSO(string data)
{
return null;
}
What am I doing wrong? Thanks