The promise returned by dojo/request/xhr has a cancellation method (for example, normal promises) that aborts the HTTP request.
var request = xhr("foo/bar").then(someHandler, someErrorHandler); ... if(!request.isResolved()) { request.cancel();
Example here: http://fiddle.jshell.net/QgWNA/
Frode source share