LWP::Simple::Post - Single-method POST requests
version 0.05
Really simple wrapper to HTTP POST requests
use LWP::Simple::Post qw(post post_xml); my $response = post('http://production/receiver', 'some text');
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.
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.
$data
$url
undef
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.
text/xml
post
text/html
Peter Sergeant - pete@clueball.com
pete@clueball.com
Copyright 2011 Pete Sergeant.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install LWP::Simple::Post, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LWP::Simple::Post
CPAN shell
perl -MCPAN -e shell install LWP::Simple::Post
For more information on module installation, please visit the detailed CPAN module installation guide.