We are converting a Flex application to use some REST APIs.
When adding the mx.rpc.http.HTTPService class to the code, the SWF binary output grew from 175KB to 260KB. This is an unacceptable hit.
Is there any better way to do lightweight REST calls from a Flex app? Are we better off using an external interface JS just to make the calls from there?
flash.net.URLLoaderis built into the runtime and won’t cause any increase in filesize. I’ve used it as a JSON client before, so you shouldn’t have any troubles with it.Below is a very simple example. See documentation for
HTTP_STATUSandHTTP_RESPONSE_STATUSfor information on their restrictions.