遇到一些麻烦:
我做了这个简单的测试,警报弹出文本“测试返回简单”:
jQuery帖子:
$.post("http://www.localhost/webapi/api/corkboard/test/", jsonData)
.done(function(data){
alert(data);
});
Asp.Net WebAPI:
[HttpPost]
public string test()
{
return "test return simple";
}
但是当我通过添加参数来更改 WebAPI 时:
public string test(string JSONData)
{
var jData = Json.Decode(JSONData);
return "test return: " + jData.Filter;
}
我收到以下错误消息:
“未找到与请求 URI ' http://www.localhost/webapi/api/corkboard/test/ '匹配的 HTTP 资源
卡住并希望有任何想法......谢谢!