Wednesday, April 2nd, 2008

Start RESTing on your laurels

By Andy Lewisohn

There’s a new ActionScript 3 library available over in the Arc90 Lab called RESTService. Now developers can make fully aware HTTP calls from Flex/AIR applications. There are some caveats for use on the web, but the desktop is fair game.

Take a look and let us know what you think.

6 Responses

  1. 4/4/2008
    phil Said:

    Looks great and works!
    How would you implement upload? I mean i can’t see how i could use FileReference and arc90restlib together.
    Phil

  2. 7/11/2008
    Andy Lewisohn Said:

    Unfortunately, the limitations of Flex would prevent you from using FileReference with RESTService. FileReference handles data in its own way, in a black box. You could use RESTService to load a file as binary, or send a file using multipart form data.

  3. 12/4/2008
    Jens Said:

    First of all I like your RESTService implementation very much, because it keeps the HTTPService feeling and adds the missing REST.
    But I think something is wrong with the implementation of multipart/form-data. In the for-loop where the content of the multipart-Request is built
    data.writeUTFBytes(“–” + boundary + “–” + SEPARATOR)
    should be outside of the loop otherwhise it is added after any form-item which results in double boundaries. Unfortunately I still cannot get it to work.
    Could you perhaps try to make a multipart/form-data request with RESTService and post a working example?
    Thanks a lot!
    Jens

  4. 9/11/2009
    Barry Johnston Said:

    I’ve read in a few places where https is not possible through the web using RESTService. However, the posts seem to be dated. I’m wondering if this is indeed true? If it was true but someone has found a solution, does anyone have information about the solution?
    Thanks,
    Barry

  5. 9/11/2009
    Barry Johnston Said:

    UPDATE: I managed to get my project working. The RESTService does support HTTPS. I just had an issue with my certificate.
    Great library, for what is’ worth, I highly recommend it.

  6. 1/11/2010
    B. Santos Said:

    Andy,

    Great work that you’ve done with this very useful REST client class!
    I’ve been able to quickly put up a simple XML based GET request with this class.

    My main comment (minor) is how the port number (as well as credentials) could be easily set through the URI/URL given in constructor or when setting the url. One should not be the need to explicitly set the port argument in such case. For example:

    RESTService service = new RESTService(“http://localhost:8080/app/rest/get”)

    as opposed to:

    RESTService service = new RESTService(“http://localhost:8080/app/rest/get”, 8080)

    Great stuff!

Leave a Comment