# Create a user agent object $ua = new LWP::UserAgent; $ua->agent("$0/0.1 " . $ua->agent); $ua->timeout(90); # Create a request my $req = new HTTP::Request POST => 'https://10.37.12.4:7001/mail'; $req ->content($my_string); # Pass request to the user agent and get a response back my $res = $ua->request($req); print $res->as_string."\n"; # Check the outcome of the response if ($res->is_success) { print $res->content; } else { print "Bad luck this time\n"; }