Though the other problem in this case is that you are not keeping the Mojo::UserAgent object alive because it's scoped inside the action: https://mojolicious.org/perldoc/Mojolicious/Guides/FAQ#What-does-Premature-connection-close-mean
On Fri, Aug 17, 2018 at 1:39 PM Dan Book <gri...@gmail.com> wrote: > You don't need to keep a reference to the controller but to the > transaction. See > https://mojolicious.org/perldoc/Mojolicious/Guides/FAQ#What-does-Transaction-already-destroyed-mean > > On Fri, Aug 17, 2018 at 1:22 PM Heiko Jansen <heiko.jansen...@gmail.com> > wrote: > >> Hmm, there's no access to the controller ($c) and no reference to it kept >> in the fullfillment or rejection callbacks. >> I'd guess it is therefore garbage collected once you leave "welcome" and >> the client connection thus closed immediately. >> >> hth, >> heiko >> >> -- >> 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 mojolicious+unsubscr...@googlegroups.com. >> To post to this group, send email to mojolicious@googlegroups.com. >> Visit this group at https://groups.google.com/group/mojolicious. >> For more options, visit https://groups.google.com/d/optout. >> > -- 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 mojolicious+unsubscr...@googlegroups.com. To post to this group, send email to mojolicious@googlegroups.com. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.