Peter Sergeant
and 1 contributors

NAME

LWP::Simple::Post - Single-method POST requests

VERSION

version 0.05

DESCRIPTION

Really simple wrapper to HTTP POST requests

SYNOPSIS

 use LWP::Simple::Post qw(post post_xml);

 my $response = post('http://production/receiver', 'some text');

OVERVIEW

DON'T USE THIS MODULE! There are very few situations in which this module would be a win over using LWP::UserAgent directly. It was a bad idea I implemented a long time ago.

This module is intended to do for HTTP POST requests what LWP::Simple did for GET requests. If you want to do anything complicated, this module is not for you. If you just want to push data at a URL with the minimum of fuss, you're the target audience.

METHODS

post

 my $content = post( string $url, string $data );

Posts the data in $data to the URL in $url, and returns what we got back. Returns undef on failure.

post_xml

 my $content = post_xml( string $url, string $data );

Having written this module, it turned out that 99% of what I needed it for required a content-type of text/xml. This does exactly what post does, only the content-type header is set to text/html.

AUTHOR

Peter Sergeant - pete@clueball.com

COPYRIGHT

Copyright 2011 Pete Sergeant.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.