Eugen Konkov
Eugen Konkov

Reputation: 25282

Why I can not repeat request with Mojo::UserAgent?

I create $tx object as:

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

Then request:

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

I got right response, but when I want to repeat request I get 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 I can not repeat request?

Upvotes: 4

Views: 196

Answers (1)

user7516038
user7516038

Reputation: 21

Mojo ua tx is not reusable so create new one.

Upvotes: 2

Related Questions