$.post("/API/Reviews/Collection", { msg: "dd" }, function () { }, "json");
或者
$.ajax({
type: "post",
url: "/API/Reviews/Collection",
data: { "msg": "dd" },
success: function (data, textStatus) {
alert(data);
},
error: function (xmlHttpRequest, textStatus, errorThrown) {
alert(textStatus + "," + errorThrown)
},
dataType: "json"
})
这两种方式post提交都不好使,报错

后台代码
[RoutePrefix("API/Reviews")]
public class ReviewController:ApiController
{
[HttpPost]
[Route("Collection")]
public string Collection(CollectionViewModel msg)
{
return "";
}
}
public class CollectionViewModel
{
public string collectionType { get; set; }
public string ResTbl { get; set; }
public string ResId { get; set; }
public string msg { get; set; }
}
求大神帮忙