NAME

LWP::Simple::REST - A simple funcional interface to LWP::UserAgent, focused to quick use and test HTTP/REST apis

VERSION

Version 0.2

SYNOPSIS

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.

SUBROUTINES/METHODS

All http verbs methods receive an url and a hashref with parameters. The other methods have each one it own interface.

GET, PUT, POST, DELETE, HEAD

They are the http verbs, they return an HTTP::Response object

plain

Receives an response and returns just the content, usually the calls will be like

my $var = plain POST ( $url, $arguments )

json

Same for above, but also decode_json the content

Old deprecated methods:

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

AUTHOR

RECSKY, <recsky at cpan.org> GONCALES, <italo.goncales at gmail.com>

BUGS

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.

SUPPORT

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

LICENSE AND COPYRIGHT

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