Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

REST Protocol using Perl

by perl@1983 (Sexton)
on Apr 13, 2011 at 18:12 UTC ( [id://899259]=perlquestion: print w/replies, xml ) Need Help??

perl@1983 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Is there any way to send a message using REST protocol in Perl? Thanks.

Replies are listed 'Best First'.
Re: REST Protocol using Perl
by MidLifeXis (Monsignor) on Apr 13, 2011 at 18:27 UTC

    Not quite sure what you mean by sending a message using REST protocol. REST is a set of resources identified by URLs, actions identified by the HTTP verbs GET (get this resource), PUT* (save / replace this resource), POST* (send some data to this resource), and DELETE (delete this resource), and document types negotiated with the HTTP headers (Accept, Content-type, and so on). Basically, REST is just HTTP.

    Are you asking how to design an application to use REST techniques? Perhaps how to respond to an HTTP request in a REST application? If you treat it just as HTTP requests as documented above, LWP, Mechanize, and REST should be some good starting points.

    * - The semantics of PUT and POST are often confused, and consensus may not always be found. These are the definitions that clicked and seem to make the most sense (at least to me). The alternative, that POST is create and PUT is update (or even the reverse), leads to some very difficult form handling (no, you have to PUT the attribute foo at widgets/widgetid/foo, and bar at widgets/widgetid/bar, you cannot just POST bar and foo to widgets/widgetid).

    --MidLifeXis

      Thanks for the reply MidLifeXis. Actually, I have a server which accepts REST requests. My requirement is to send REST message to that server and receive the response (using a Perl script). I also searched for resources online, but some of them like http://search.cpan.org/~mcrawfor/REST-Client-88/lib/REST/Client.pm are not available in my office that's why I am looking for alternatives. Please let me know if this helps to understand the requirement.
Re: REST Protocol using Perl
by wind (Priest) on Apr 13, 2011 at 18:18 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://899259]
Approved by sierpinski
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-19 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found