LWP::Simple::REST - A simple funcional interface to LWP::UserAgent, focused to quick use and test HTTP/REST apis
Version 0.2
This module is a simple wrapper for simple http requests. It provides functions to create clients to whatever http services, mainly REST ones. The goal is to be simple and straight forward.
This version 0.2 tries to make it simpler, instead of have dozens of methods we just have the basic method and let you combine them as you need. The old ones are kept for compatibilty but are now deprecated.
This is the actual main example:
use LWP::Simple::REST qw/POST json plain/; my $foo = plain POST ( "http://example.org", { example => "1", show => "all" } ); or decoding the interface my $foo = json POST ( "http://example.org", { example => "1", show => "all" } );
In fact, the old http_post routine is actually just a wrapper for plain POST
The http verbs are all caps, and normal methods are in low case. You need to ask to export them.
All http verbs methods receive an url and a hashref with parameters. The other methods have each one it own interface.
They are the http verbs, they return an HTTP::Response object
Receives an response and returns just the content, usually the calls will be like
my $var = plain POST ( $url, $arguments )
Same for above, but also decode_json the content
http_get, http_post, http_delete http_head http_upload json_get json_post
Are old methods kept just for compatibility, actually it will be preferred to use the new interface:
headers HEAD $url, $parameters
RECSKY, <recsky at cpan.org> GONCALES, <italo.goncales at gmail.com>
<recsky at cpan.org>
<italo.goncales at gmail.com>
Please report any bugs or feature requests to bug-lwp-simple-rest at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LWP-Simple-REST. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-lwp-simple-rest at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc LWP::Simple::REST
Usually we are on irc on irc.perl.org.
#sao-paulo.pm
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=LWP-Simple-REST
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/LWP-Simple-REST
CPAN Ratings
http://cpanratings.perl.org/d/LWP-Simple-REST
Copyright 2014 GONCALES Copyright 2014 RECSKY
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
To install LWP::Simple::REST, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LWP::Simple::REST
CPAN shell
perl -MCPAN -e shell install LWP::Simple::REST
For more information on module installation, please visit the detailed CPAN module installation guide.