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 ( "", { example => "1", show => "all" } );
    or decoding the interface

    my $foo = json POST ( "", { 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

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


RECSKY, <recsky at> GONCALES, <italo.goncales at>


Please report any bugs or feature requests to bug-lwp-simple-rest at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc LWP::Simple::REST

Usually we are on irc on


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: