文章:webapi设置一个Action同时支持get和post请求html
这篇文章,有提供方法。参数前加上[FromUri]web
[AcceptVerbs("GET", "POST")] public HttpResponseMessage Http([FromUri]ProxyHttpParam getParam, ProxyHttpParam postParam) { var res = new HttpResponseMessage(HttpStatusCode.OK); return res; }
我的思考是由于路由的严格限制致使的问题。mvc中曾经碰到这种问题api
临时方法是:干掉方法的参数,在方法内部进行参数接收,Request["data"];mvc