以下是我对DELETE请求的Ajax 请求:
deleteRequest: function (url, Id, bolDeleteReq, callback, errorCallback) {
$.ajax({
url: urlCall,
type: 'DELETE',
headers: {"Id": Id, "bolDeleteReq" : bolDeleteReq},
success: callback || $.noop,
error: errorCallback || $.noop
});
}
Run Code Online (Sandbox Code Playgroud)
有没有其他方法来传递数据而不是headers?
Gab*_*oli 94
阅读此Bug问题:http://bugs.jquery.com/ticket/11586
该
DELETE方法请求源服务器删除Request-URI标识的资源.
所以你需要传递URI中的数据
$.ajax({
url: urlCall + '?' + $.param({"Id": Id, "bolDeleteReq" : bolDeleteReq}),
type: 'DELETE',
success: callback || $.noop,
error: errorCallback || $.noop
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
96425 次 |
| 最近记录: |