Loading external data through REST services

You can load external data in Apache Royale using the HTTPService class. Use HTTPService to make POST, GET, PUT and DELETE operations for requests on external data for REST services.


In Apache Royale we have two HTTPService implementations:

  • MXRoyale: Is an emulation of the implementation that Flex applications use. It is the best option if you’re migrating from Flex since it supports the same API that the Flex framework uses.

  • Network: Is a newer bead implementation. This is still under development, so you may run into some issues that will need to be resolved.


In Apache Royale you can write an mx:RemoteObject like this:

    	<mx:HTTPService id="srv" useProxy="false" resultFormat="text"
            result="resultHandler(event)" fault="faultHandler(event)"/>

You can write the Network implementation like this:

    <js:HTTPService id="service">
        <js:LazyCollection id="collection">
                <js:JSONInputParser />
                <local:StockDataJSONItemConverter />