#!/usr/local/bin/perl -w use strict; use LWP::UserAgent; my $status = 'SOME_STATUS'; my $path = '/verify'; our $params; # fake server to verify against package MyServer; use HTTP::Server::Simple::CGI; use base qw(HTTP::Server::Simple::CGI); sub handle_request { my $self = shift; my $cgi = shift; my $p = $cgi->path_info(); $params = $cgi->Vars; #hardcoding this value doesn't help print "HTTP/1.0 200 OK\r\n"; if ( $p eq $path ) { print "Content-Type: text/plain\r\n"; print "Content-Length: ".length($status)."\r\n\r\n"; print "status\r\n"; } } package main; my $pid = MyServer->new(8000)->background(); my $ua = LWP::UserAgent->new; $ua->timeout( 1 ); my $ures = $ua->post('http://localhost:8000/verify', { v1 => 'abc', v2 => 'def' }); kill( 3, $pid); print "params were : $params\n"; # expect to see { v1 => 'abc' ... }