in reply to Re^3: AnyEvent::HTTP and getting data back from a post request
in thread AnyEvent::HTTP and getting data back from a post request
That doesn't sound right . I would use PERL_ANYEVENT_VERBOSE=1 perl yada... and maybe add
and maybe add Devel::Trace (since AnyEvent::Trace is in the TODO que)use AnyEvent::Strict;
I think that the http_* methods work by making a call to the defined URL, and then process - upon completion of the http request sequence - the block that is the anonymous subroutine.... is that right?
Yes, http_* will invoke/call/execute the callback/nameless/anonymous-sub you pass, after its done what it can, either upon completion, or upon error -- the docs are very clear on this :)
Does the original code have the requisite loop or holding stuff to wait until all the http calls have been made, and responded? (I think this may actually be my problem.)
I think so. In fact, after reading some more documentation, I think with your original posted code, you could get rid of my $cb = AnyEvent->condvar; and instead return
Then, instead of print Dumper(\@responses);return http_post( ...
for my $response ( @responses ){ print "$response ", $response->recv, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: AnyEvent::HTTP and getting data back from a post request
by kiz (Monk) on Jan 27, 2011 at 16:13 UTC |