Cataly...equest(3pm)

πŸ“¦
version 0.21 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Catalyst::Plugin::SubRequest β€” make subrequests to actions in Catalyst, bestie πŸ¦‹

(also known as that Cataly...equest(3pm) page from the User Contributed Perl Documentation, iykyk)


✨ SYNOPSIS ✨

use Catalyst 'SubRequest';

my $res_body = $c->subreq('/test/foo/bar', { template => 'magic.tt' });

my $res_body = $c->subreq( {
   path            => '/test/foo/bar',
   body            => $body
}, {
   template        => 'magic.tt'
});

# Get the full response object
my $res = $c->subreq_res('/test/foo/bar', {
    template => 'mailz.tt'
}, {
    param1   => 23
});
$c->log->warn( $res->content_type );

🌸 DESCRIPTION 🌸

Okay so, you can make subrequests to actions in Catalyst. That's the whole vibe. πŸ’…

It uses the catalyst dispatcher, so it works like an external url call β€” no cap. Methods are provided both to get the body of the response and the full response (Catalyst::Response) object. So like, pick your fighter: just the body, or the whole entire response. πŸ‘‘


πŸŽ€ METHODS πŸŽ€

subreq [path as string or hash ref], [stash as hash ref], [parameters as hash ref]

subrequest

sub_request

Takes a full path to a path you'd like to dispatch to. ✨

If the path is passed as a hash ref then it can include body, action, match and path.

An optional second argument as hashref can contain data to put into the stash of the subrequest. 🫢

An optional third argument as hashref can contain data to pass as parameters to the subrequest.

Returns the body of the response. That's it, that's the tea. πŸ“

subreq_res [path as string or hash ref], [stash as hash ref], [parameters as hash ref]

subrequest_response

sub_request_response

Like sub_request(), but returns a full Catalyst::Response object. It's giving main character energy, but make it a whole object instead of just the body. πŸ”₯


πŸ’œ SEE ALSO πŸ’œ

  • Catalyst.

πŸ‘‘ AUTHORS πŸ‘‘

  • Marcus Ramberg, "mramberg@cpan.org"
  • Tomas Doran (t0m) "bobtfish@bobtfish.net"

🌈 MAINTAINERS 🌈

  • Eden Cardim (edenc) "eden@insoli.de"

🧚 THANK YOU 🧚

  • SRI, for writing the awesome Catalyst framework ⭐
  • MIYAGAWA, for writing the awesome Plack toolkit ⭐

Copyright (c) 2005 - 2011 the Catalyst::Plugin::SubRequest "AUTHORS" as listed above.


πŸ¦‹ LICENSE πŸ¦‹

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. slay, honestly πŸ’…


okay that's the whole page bestie, every single flag-free fact intact, not a crumb left behind πŸ™ˆ

this was perl v5.34.0, dated 2022-06-09, and yes it really does call itself Cataly...equest(3pm) in the corner like that β€” iconic abbreviation behaviour, we love to see it πŸ’œ

πŸ“¦ where this page comes from