My component
POE::Component::Client::HTTP->spawn(
Agent => "MyScript/1.0",
Alias => 'browser',
Timeout => 60,
FollowRedirects => 3,
);
This is the event handler of another POE component from where the HTTP request is sent
sub connected {
my ($heap,$kernel) = @_[HEAP,KERNEL];
my $request = POST 'http://mydomain.com', [qw(hello world this is my script)];
$kernel->post('browser','request','response',$request);
}
sub response {
print "I am inside the response handler!\n"; # It never reaches here
}
I checked my Webserver logs and the HTTP request is sent correctly but it doesn't send the HTTP::Response object (or anything) to the response handler. What did I do wrong?
Sorry, this question can be closed. I was supposed to create a POE::Session with the response handlers and call $kernel->post() from it's _start handler.