- #TODO
- Fixed crash when no connection on Android
- Fixed close connection using HTTP/1.1 (thanks to PaulGene #32)
- Using Haxe 3.3 allow support for SSL in most platform out of the box
- Beautify code
- Minor fixes
- Added callbackProgress
- Minor fixes
- Fix uncatchable exceptions in multi-threaded execution
- No more throwing, just log and passing response.error variable
- Added comments to all public methods
- Better class scope
- Removed errorSafe, introduced logErrorEnabled
- Added optional callbackError (to avoid the IF in the callback function)
- Better internal content handling
// These two requests are equivalent (you choose which way you prefer)
// One single callback
var request = new HttpRequest({
url : "http://www.google.com",
callback : function(response:HttpResponse):Void {
if (response.isOK) {
trace(response.content);
trace('DONE (HTTP STATUS ${response.status})');
} else {
trace('ERROR (HTTP STATUS ${response.status})');
}
}
});
// One callback for success and one for failure
var request = new HttpRequest({
url : "http://www.google.com",
callback : function(response:HttpResponse):Void {
// response.isOK is True
trace(response.content);
trace('DONE (HTTP STATUS ${response.status})');
},
callbackError : function(response:HttpResponse):Void {
// response.isOK is False
trace('ERROR (HTTP STATUS ${response.status})');
}
});
- SSL support! (cpp+neko using hxssl, java+js+flash using standard haxe)
- Easier instances (options instead of arguments for new Request objects)
- Better redirect handling (default max redirection set to 10 + relative redirection URLs support)
- Custom headers on Request (cpp+neko only)
- Removed autoparse option
- User-agent option
- HTTP version option (1.0 or 1.1)
- Synchronous/Asynchronous option
- Request cloning (to perform a request more than once)
The API change is breaking: Instead of making an AsyncHttpRequest object with 2 parameters
// version <= 3.x
new AsyncHttpRequest('urlString',function(response:AsyncHttpResponse) { ... });
you can pass every setting as options (new classes' names: HttpRequest and HttpResponse)
// version >= 4.x
new HttpRequest({url:'urlString',callback:function(response:HttpResponse) { ... }});
Fix your code! This edit was necessary to make future improvements easier with less future API changes.
- Timeout option (request)
- Handling unexpected connection termination
- The library doesn't rely on OpenFL anymore and it is a pure Haxe library!
- Flash target use the default URLLoader (async)
- Javascript target use the default Haxe.Http (async XmlHttpRequest)
- The content (both on request and response) is now fully functional.
- The library is now thread-safe (major problems in 0.2)
- Support for redirection (HTTP STATUS 30x)
- Using sockets make requests around 50% faster than OpenFL URLLoader
- First public release (relying on OpenFL)