As3HttpClientLib is a HTTP client for AS3. It uses AS3Crypto TLSSocket support for implementing HTTPS. The lib can be used as a replacement for Flash’s URLRequest/URLStream API.
Some features:
- GET, HEAD, PUT, POST, DELETE
- multipart/form-data (PUT and POST)
- Post with application/x-www-form-urlencoded
- Reading chunked (Transfer-Encoding)
Sample
var client:HttpClient = new HttpClient(); client.listener.onStatus = function(event:HttpStatusEvent):void { // Notified of response (with headers but not content) }; client.listener.onData = function(event:HttpDataEvent):void { // For string data var stringData:String = event.readUTFBytes(); // For data var data:ByteArray = event.bytes; }; client.listener.onComplete = function(event:HttpResponseEvent):void { // Notified when complete (after status and data) }; client.listener.onError = function(event:ErrorEvent):void { var errorMessage:String = event.text; }; var uri:URI = new URI("http://www.google.com/search?q=rel-me"); client.get(uri);
New: As3HttpClientLib (http client supporting GET, POST, PUT, HTTPS, multipart/form data & more) http://t.co/LMmZJ27C #as3 #flash #gamedev