【发布时间】:2013-11-09 07:51:03
【问题描述】:
C#(from the controller(MVC)) 中 POSTing value into a Web API method using a standard jQuery $.post 的等价物是什么,
我使用标准的 jQuery $.post 让它工作,像这样:
$.post('/api/reports', { AgentId: AgentId, ReportName: ReportName, Params: Params, StatsEmailedId: StatsEmailedId, HeaderName: HeaderName,
RankBy: RankBy, SoldCountsInclude: SoldCountsInclude, SortBy: SortBy, IncludeCo: IncludeCo, DisplayTop: DisplayTop, UserOffice: UserOffice
},
function (data) { ....
}
});
【问题讨论】:
-
我不确定我是否理解 - 你的意思是你想从你的控制器调用你自己的 WebAPI 方法之一?
-
没错。 Webapi 与我要从中调用它的项目位于一个单独的项目中。
标签: jquery .net asp.net-mvc asp.net-web-api http-post