中止DoJo XHR请求
我正在使用该模块进行HTTP请求。中止DoJo XHR请求,dojo,xmlhttprequest,abort,Dojo,Xmlhttprequest,Abort,我正在使用该模块进行HTTP请求。 是否可以中止活动请求,就像使用 提前谢谢大家,, Frankdojo/request/xhr返回的承诺有一个cancel方法(与普通承诺类似),该方法中止HTTP请求 var request = xhr("foo/bar").then(someHandler, someErrorHandler); ... if(!request.isResolved()) { request.cancel(); // aborts request and trigge
是否可以中止活动请求,就像使用 提前谢谢大家,,
Frankdojo/request/xhr返回的承诺有一个cancel方法(与普通承诺类似),该方法中止HTTP请求
var request = xhr("foo/bar").then(someHandler, someErrorHandler);
...
if(!request.isResolved()) {
request.cancel(); // aborts request and triggers the error handler
}
示例:您的解决方案有效。但是使用XMLHttpRequest.abort()也会停止相应的服务器进程。request.cancel()没有。是否可以另外停止服务器进程?