Flex: No REST for the Wicked
December 13th, 2006
I’ve been back to doing some playing around with Flex 2 and some other technologies I work with. I’m now much happier now we have Flex Builder on the Mac. My trial license of Parallels was up and I was debating opening my wallet.
Anyway looking in the documentation for HTTPService I could see it handled PUT,DELETE etc and I thought, thats great, lets do some REST stuff.
To make a long story short I couldn’t make a Flex application do more than GET and POST. A quick search found me this. The extended set of methods rely on having the Flex Proxy which is essentially part of Flex Data Services.
Shame really, REST support in the player would be great for some modern XML over HTTP applications, and using the proxy means basically having to pay the FDS licenses.
My thought is this. why does the proxy have to be part of Flex Data Services. The Flex proxy allows for connecting to data across the web sans cross-domain.xml. Truely this is needed for the Native Web of Data. We possibly shouldn’t need the full power (and cost) of FDS to get hold of this.
Any ideas?
2 Responses to “Flex: No REST for the Wicked”
Sorry, comments are closed for this article.
December 14th, 2006 at 06:12 AM
With RoR, at least, there’s a workaround which was put into the framework to deal with the fact that most browsers don’t support PUT or DELETE. Just set the HTTPService’s method to POST and append _method=PUT or _method=DELETE to the query string in the service’s URL. (i.e. ”/foos/1?_method=DELETE”)
The real PITA is the fact that you can’t really make use of the HTTP response codes such as 404 or 403. It would seem that anything other than a 200 (or maybe just 2xx) is treated as an error and invokes the fault handler. :-(
December 27th, 2006 at 09:40 PM
Apollo won’t have flash’s crossdomain url loading issues. You could possibly write a proxy in rails to do the job…