Subject: | unique_id tag not posted back to response event |
The unique id tag disapears somewhere between posting the request and
getting the response event. I had hoped that this sample program would
print "Got response with id 12345." but $req_id comes back as undef.
#!/usr/bin/perl
use warnings;
use HTTP::Request::Common qw(GET);
use POE qw(Component::Client::HTTP);
POE::Component::Client::HTTP->spawn(Alias => 'ua');
POE::Session->create(
inline_states => {
_start => sub {
my ($kernel,$heap) = @_[KERNEL, HEAP];
$kernel->post(
'ua',
'request',
'got_response',
GET 'http://www.google.com/',
'12345',
);
},
got_response => sub {
my ( $kernel, $heap, $request_packet ) =
@_[KERNEL, HEAP, ARG0 ];
my $req_id = $request_packet->[1];
print "Got response with id $req_id.\n";
},
}
);
$poe_kernel->run();