Skip Menu |

This queue is for tickets about the POE-Component-Client-HTTP CPAN distribution.

Report information
The Basics
Id: 35951
Status: resolved
Priority: 0/
Queue: POE-Component-Client-HTTP

People
Owner: Nobody in particular
Requestors: dave [...] frop.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.83
Fixed in: (no value)



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();
From: dave [...] frop.net
Unless I am missing something, it looks like POE::Component::Client::HTTP::Request doesn't do anything with the "Tag" parameter that POE::Component::Client::HTTP::RequestFactory passes to the Request constructor.
From: dave [...] frop.net
Sorry, this was a bug with my program. the GET function was swallowing up the '12345' tag, it works fine when I call GET with parentheses. It still looks like the tag is passed needlessly to POE::Component::Client::HTTP::Request->new though.
You appear to be right. Tag isn't needed by POE::Component::Client::HTTP::Request. I've commented it out in revision 357. If nothing explodes, we'll remove it altogether in the future.