Yeah I hope someone pursues that feature request because having the different types of URLs “just work” everywhere URLs should would be awesome.
In this case, is the XHR interface itself critical though?
Because at least with ATP the remote data can be retrieved another way:
Assets.downloadData('atp:012345689abcdef',
function(data) { print('retrieved ' + data.length + ' bytes of ATP data'); }
)
This API method doesn’t seem to support error handling callbacks yet, so what I do for now is wrap it in a Promise + timeout chain (this requires using a polyfill for Promise support and assumes after N seconds some kind of error has occurred):
function fetchATP(atpURL) {
return new Promise(function(resolve, reject) {
Assets.downloadData(atpURL, resolve);
}).timeout(5000);
}
fetchATP('atp:012345689abcdef')
.then(function(data) { print('data', data.length); })
['catch'](function(err) { print('error retrieving ATP: ', err); });