我正在向 Web API Controller -“/api/customers”发送“POST”请求。但是,检查请求对象却显示“GET”请求。
$.ajax({
url: "/api/customers",
type: "POST",
data: jsonSerialize,
dataType: "jsonp"
});
最佳答案
使用 JSONP 时无法执行发布。您必须将类型更改为 GET,或将 dataType 更改为 JSONP 以外的其他类型。
http://forum.jquery.com/topic/post-query-with-jquery-ajax-and-jsonp-datatype
关于jQuery 'POST' 在 ASP.NET Web API beta 中被视为 'GET',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9758845/