CoderZone.org

Category: >> Perl Code >> HTTP Post With Perl Bookmark and Share

<< lastnext >>

Snippet Name: HTTP Post With Perl

Description: Make an HTTP post with Perl.

Also see:
» Get File Size Over HTTP

Comment: (none)

Author: CoderZone
Language: PERL
Highlight Mode: PERL
Last Modified: December 03rd, 2010

use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
 
my $user = "user";
my $pass = "pass";
 
my $browser = LWP::UserAgent->new();
 
my $response = HTTP::Request->new(POST => "http://www.sito.com/index.php");
$response->content_type("application/x-www-form-urlencoded");
$response->content("user=" . $user . "&pass=" . $pass);
 
$browser->request($response)->as_string
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 6