我的组件
POE::Component::Client::HTTP->spawn(
Agent => "MyScript/1.0",
Alias => 'browser',
Timeout => 60,
FollowRedirects => 3,
);
这是发送 HTTP 请求的另一个 POE 组件的事件处理程序
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
}
我检查了我的 Web 服务器日志,并且 HTTP 请求已正确发送,但它没有将 HTTP::Response 对象(或任何东西)发送到响应处理程序。我做错了什么?