Why can't I retry the request with Mojo :: UserAgent?

I create an object $txas:

my $tx =  $self->ua->build_tx( $method, ... );

Then request:

my $res =  $self->ua->start( $tx )->res;

I got the correct answer, but when I want to repeat the request, I get an error:

my $repeat =  $self->ua->start( $tx )->res;
Can't call method "stream" on an undefined value at /local/lib/perl5/Mojo/UserAgent.pm line 155.

Why can't I repeat the request?

+4
source share
1 answer

Mojo ua tx cannot be reused, so create a new one.

+2
source

Source: https://habr.com/ru/post/1668790/


All Articles