webapi同時支持post和get報404錯誤

 

文章: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

相關文章
相關標籤/搜索