views:

61

answers:

2

I'm developing a social game in Flash with a team of developers. Our server-side guy has developed a really slick RESTful API for the Flash client to talk to. A lot of the client-server interactions involve adding and removing objects from a persistent world, so the API makes extensive use of the PUT and DELETE verbs.

The problem is, the URLRequest object in AS3 only supports the GET and POST verbs.

We're on a strict schedule, and we'd really rather not have to rewrite the whole API to just use GET and POST. Has anyone come up with a good way to get Flash to send other verbs?

+2  A: 

This appears to be the project to use. as3httpclient

HTTPURLLoader also provides different HTTP status messages and can be used for different HTTP methods.for different HTTP methods.

jessegavin
+1. that's THE library for HTTP in as3. :)
back2dos
Does as3httpclient use XMLSockets? I keep getting Socket Errors when I try to use SocketURLRequests. It looks like a great library, but the Socket Errors are kind of frustrating.
tedw4rd
Never mind! The Socket Errors went away when I used SocketHTTPRequest.createInstanceFromURLRequest to make the SocketHTTPRequests. They should really include that in the documentation.
tedw4rd
+1  A: 

Flash Player 10.1 offers native support for all of the verbs. I've run into permissions issues with the socket connections in the latest versions of Flash Player, so you might have to switch over to native functionality soon, or support both ways of accessing REST.

Dusty J