在我能够向node.js应用程序发出DELETE请求之前,我需要设置任何配置吗?
我可以进行GET、POST或PUT请求,但DELETE请求无法工作。
DELETE http://localhost:8081/api/1.0/entry
从路由记录器中返回undefined
,我正在使用express注册路由。但看起来我甚至无法解析url / verb。
这是我调用它的方式:
rows.find('a.remove').on('click', function(){
$.ajax({
url: '/api/1.0/entry',
type: 'DELETE'
}).done(function(res){
var row = $(this).parentsUntil('tbody');
row.slideUp();
});
});
示例日志
GET / 200 18ms
GET /author/entry 200 10ms
GET /api/1.0/entry 200 2ms
GET /api/1.0/entry 200 1ms
GET /api/1.0/entry 200 1ms
undefined
.del
? - bevacqua