Perhaps this way:
my $tx = $ua->build_tx($method => ... normal get/post/etc args ...);
$ua->start($tx => sub {
  ...
});

On Fri, Apr 10, 2015 at 4:01 PM, Charlie Brady <
[email protected]> wrote:

>
> https://github.com/kraih/mojo/wiki/Blocking-vs-non-blocking-101
>
> I see I can do this to have a non-blocking get handler:
>
> ...
>   $self->render_later;
>
>   $self->ua->get('http://www.superhugepage.com/blah.html' => sub {});
> ...
>
> But I don't understand how to use Mojo::UserAgent in an 'any' handler,
> where method might be 'get', 'put', 'delete', etc. Do I build a tx, attach
> the callback to 'finish', then start it? Or just do:
>
> $method = $self->req->method;
> $self->ua->$method()
>
> ?
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to