Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: A RESTful API framework

by ctilmes (Priest)
on Nov 10, 2009 at 18:46 UTC ( #806313=note: print w/replies, xml ) Need Help??

in reply to A RESTful API framework

I like some of the things that Catalyst::Controller::REST does, you might take a look at it -- it follows a similar approach to what you are proposing, but in the context of Catalyst.

In particular, it unpacks the supplied content (if you want) based on the format specified by the "Content-Type" header, and serializes your output data structure. (It uses Content-Type for that too -- I think it should use "Accept" for that.)

Your GET/PUT/POST handler doesn't have to deal with that at all, but the user can supply input in whatever format they want: XML, YAML, JSON, etc. and consume your results however they want. The perl handler can just deal with native perl data structures.

Replies are listed 'Best First'.
Re^2: A RESTful API framework
by jeteve (Pilgrim) on Nov 10, 2009 at 19:24 UTC
    Yep, that's interesting.

    I'm planning to allow you to plugin your own crafted Apache2::Request subclass in the system, so if you need a specific deserialization, you'd be able to implement it yourself.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://806313]
Discipulus is Corion reading 'Gory details of parsing quoted constructs'?..
[perldigious]: That's awesome erix. One of my work friends, who coincidentally convinced me to learn Perl originally, has a Finnish pen-pal. I showed him this and he immediately wanted to send it along to her.
[perldigious]: Also coincidentally, I'm currently in the middle of a winter storm that has dropped 1 foot of snow and is expected to drop another. I might have to adapt this for customers/vendors who come visit and put it at the beggining of every presentation I give.
[Discipulus]: the photo was removed... Cyrano de Berjerac was not of the same idea..

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2016-12-06 16:24 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (112 votes). Check out past polls.