Packageyourminis.api.net
Classpublic class HTTPLoader
InheritanceHTTPLoader Inheritance flash.net.URLLoader

An HTTP-related helper class

See also

yourminis.api.Widget.newHTTP()


Public Properties
 PropertyDefined by
  paramObj : Object
HTTPLoader
Public Methods
 MethodDefined by
  
getProxyUrl(url:String):String
Helper function to build the yourminis proxy URL
HTTPLoader
  
load(request:URLRequest):void
Load and Proxy an HTTP Request.
HTTPLoader
Property detail
paramObjproperty
public var paramObj:Object
Method detail
getProxyUrl()method
public function getProxyUrl(url:String):String

Helper function to build the yourminis proxy URL

Parameters
url:String — The URL to be proxied

Returns
String

See also


Example
Create a URLRequest object and proxy URL
 var loader:URLLoader = new URLLoader();
 loader.addEventListener(Event.COMPLETE, completeHandler);
  
 var url:String = "http://www.some3rdPartyDomain.com/server.php";
 var request:URLRequest = new URLRequest(widget.newHTTP().getProxyUrl(url));
 try {
  loader.load(request);
 } catch (error:Error) {
  trace("Unable to load requested document.");
 }
 
 function completeHandler(event:Event):void {
  var loader:URLLoader = URLLoader(event.target);
  trace("loaded: " + loader.data);
 }
 

load()method 
public override function load(request:URLRequest):void

Load and Proxy an HTTP Request. The request will be proxied from the yourminis widget server.

Parameters
request:URLRequest — The URL of the request.

See also


Example
The following code will parse an rss feed and display the titles of each item
 var http = widget.newHTTP();
 http.addEventListener(Event.COMPLETE,onHttpLoaded);
 http.load(new URLRequest("http://feeds.feedburner.com/yourminis"));
 function onHttpLoaded(evt:Event)
 {
  var loader:URLLoader = URLLoader(evt.target);
  trace(loader.data.toString());
  //...
 }