Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Webservice in Perl

by afresh1 (Hermit)
on Oct 06, 2011 at 05:01 UTC ( #929936=note: print w/ replies, xml ) Need Help??


in reply to Webservice in Perl

A newer option that I enjoy using is Mojolicious. I don't believe there are any books on it yet, but a fair amount of online documentation. A simple example web service from the Mojolicious web site looks like this:

# RESTful web service with JSON and text representation get '/list/:offset' => sub { my $self = shift; my $numbers = [0 .. $self->param('offset')]; $self->respond_to( json => {json => $numbers}, txt => {text => join(',', @$numbers)} ); };
l8rZ,
--
andrew


Comment on Re: Webservice in Perl
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://929936]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2014-07-29 04:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls