For haxe >= 3.1 use the haxe Http class as it has cancel() function