【发布时间】:2014-03-29 02:23:25
【问题描述】:
我试图将整个对象传递给我的 API 的删除方法,但执行永远不会到达它。
客户端(角度)
$http({
method: 'DELETE',
url: framewidth + "codebook/DeleteSection/",
data: $scope.codesection
})
服务器(Web API 2)
[HttpDelete]
public int DeleteSection(Domain.Code.CodeSection section)
{
// repo.Delete(Mapper.Map<EF.Code.CodeSection>(section));
return (section.Id);
}
完全相同的设置但使用 POST 适用于执行创建操作的方法。 是否也不可能通过 DELETE 动词请求传递整个对象?
谢谢!
【问题讨论】: