POST form variables to simple parameters of a Web API method in ASP.NET MVC 4 Web API
$.ajax({
url: 'api/products',
type: 'POST',
data: { Id: 2012, Name: 'test', Category: 'My Category', Price: 99.5 },
dataType: 'json',
success: function (data) {
alert(data);
}
});
but its not working how to do this?
Context.Request.Form[]to get the post data. It has the advantage that ashx files are nice and fast.ApiController?