Result:
found more than 556 distributions - search limited to the first 2001 files matching your query ( run in 0.858 )


Catalyst-Controller-SOAP

 view release on metacpan or  search on metacpan

lib/Catalyst/Action/SOAP/DocumentLiteralWrapped.pm  view on Meta::CPAN


 __PACKAGE__->{config}{soap_action_prefix} = 'http://foo/bar/';

 use base 'Catalyst::Controller::SOAP::DocumentLiteralWrapped';
 # or
 sub endpoint : Local ActionClass(SOAP::DocumentLiteralWrapped) { }

=head1 DESCRIPTION

Microsoft has defined a pseudo-standard for SOAP usage called
Document/Literal Wrapped. This standard is a deviation of both the

 view all matches for this distribution


Catalyst-ControllerPerContext

 view release on metacpan or  search on metacpan

lib/Catalyst/ControllerRole/URI.pm  view on Meta::CPAN


after 'register_action_methods', sub {
  my ( $self, $app, @methods ) = @_;
  my $class = ref $self;

  my @endpoints = ();
  my @types = @{ $app->dispatcher->dispatch_types ||+[] };
  foreach my $type (@types) {  
    if(ref($type) eq 'Catalyst::DispatchType::Chained') {
      foreach my $endpoint(@{ $type->{_endpoints} || [] }) {
        if ($endpoint->class eq $class) {
          push @endpoints, [$endpoint, $self->_generate_uri_pattern($type, $endpoint)];
        }
      }
    }
  }

lib/Catalyst/ControllerRole/URI.pm  view on Meta::CPAN

  my $col2_width = $avail_width - $col1_width;
  my $paths = Text::SimpleTable->new(
    [ $col1_width, 'uri' ], [ $col2_width, 'helper' ],
  );

  foreach my $endpoint_proto (@endpoints) {
    my $endpoint = $endpoint_proto->[0];
    my $uri = $endpoint_proto->[1];
    my $path_args = '';
    my $path_arg_count = 0;
    if(my @path_args = @{$endpoint_proto->[2]||[]}) {
      $path_arg_count = scalar(@path_args);
      $path_args = join ',', @path_args if scalar(@path_args) > 0;
      $path_args = "([$path_args])";
    }
    my $name = $endpoint->name;
    my $private_path = $endpoint->private_path; $private_path =~s/^\///; $private_path =~s/\//_/g;
    my $sub = sub {
      my $self = shift;
      my ($parts, @args) = $self->_normalize_uri_args(@_);  
      return $self->ctx->uri_for($self->action_for($name), $parts, @args);
    };

lib/Catalyst/ControllerRole/URI.pm  view on Meta::CPAN

    {
      no strict 'refs';
      my $controller_helper = "${class}::${name}_uri";
      *{$controller_helper} = Sub::Util::set_subname $controller_helper => $sub;
      my $app_helper = "${app}::${private_path}_uri";
      my $helper = $endpoint->private_path;
      *{$app_helper} = Sub::Util::set_subname $app_helper => sub {
        my $c = shift;
        return $c->uri_for($c->dispatcher->get_action_by_path($helper), @_);
      };
    }

lib/Catalyst/ControllerRole/URI.pm  view on Meta::CPAN


  $app->log->debug("URI Helpers for: $class\n" . $paths->draw . "\n");
};

sub _generate_uri_pattern {
  my ($self, $dispatcher, $endpoint) = @_;
  my $args = $endpoint->list_extra_info->{Args};

  my @parts;
  if($endpoint->has_args_constraints) {
      @parts = map { "{$_}" } $endpoint->all_args_constraints;
  } elsif(defined $endpoint->attributes->{Args}) {
      @parts = (defined($endpoint->attributes->{Args}[0]) ? (("*") x $args) : '...');
  }

  my @parents = ();
  my $parent = "DUMMY";
  my $extra  = $dispatcher->_list_extra_http_methods($endpoint);
  my $consumes = $dispatcher->_list_extra_consumes($endpoint);
  my $scheme = $dispatcher->_list_extra_scheme($endpoint);
  my $curr = $endpoint;
  while ($curr) {
      if (my $cap = $curr->list_extra_info->{CaptureArgs}) {
          if($curr->has_captures_constraints) {
              my $names = join '/', map { "{$_}" } $curr->all_captures_constraints;
              unshift(@parts, $names);

 view all matches for this distribution


Catalyst-ControllerRole-At

 view release on metacpan or  search on metacpan

t/at.t  view on Meta::CPAN


extends 'Catalyst::Controller';

sub root :At($controller/...) { }

  sub endpoint :Via(root) At({id}) {
    my ($self, $c, $id) = @_;
  }

  sub endpoin2 :Under(root) At({id}/{@}) {
    my ($self, $c, @args) = @_;

t/at.t  view on Meta::CPAN


extends 'Catalyst::Controller';

sub root Chained(/) PathPrefix CaptureArgs(0) { }

  sub endpoint :Chained(root) PathPrefix('') Args(1) {
    my ($self, $c, $id) = @_;
  }

  sub endpoin2 :Chained(root) PathPrefix('') Args {
    my ($self, $c, @args) = @_;

 view all matches for this distribution


Catalyst-Engine-Apache

 view release on metacpan or  search on metacpan

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN

sub foo  :PathPart('chained/foo')  :CaptureArgs(1) :Chained('/') {
    my ( $self, $c, @args ) = @_;
    die "missing argument" unless @args;
    die "more than 1 argument" if @args > 1;
}
sub endpoint  :PathPart('end')  :Chained('/action/chained/foo')  :Args(1) { }

#
#   Parent/child test with two args each
#
sub foo2 :PathPart('chained/foo2') :CaptureArgs(2) :Chained('/') { }
sub endpoint2 :PathPart('end2') :Chained('/action/chained/foo2') :Args(2) { }

#
#   Relative specification of parent action
#
sub bar :PathPart('chained/bar') :Chained('/') :CaptureArgs(0) { }
sub finale :PathPart('') :Chained('bar') :Args { }

#
#   three chain with concurrent endpoints
#
sub one   :PathPart('chained/one') :Chained('/')                   :CaptureArgs(1) { }
sub two   :PathPart('two')         :Chained('/action/chained/one') :CaptureArgs(2) { }
sub three_end :PathPart('three')       :Chained('two') :Args(3) { }
sub one_end   :PathPart('chained/one') :Chained('/')   :Args(1) { }

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN

sub priority_c2 :PathPart('') :Chained('priority_c1') { }
sub priority_c2_xyz :PathPart('xyz') :Chained('priority_c1')  { }


#
#   Optional specification of :Args in endpoint
#
sub opt_args :PathPart('chained/opt_args') :Chained('/') { }

#
#   Optional PathPart test -> /chained/optpp/*/opt_pathpart/*

 view all matches for this distribution


Catalyst-Engine-HTTP-POE

 view release on metacpan or  search on metacpan

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN


#
#   Simple parent/child action test
#
sub foo  :PathPart('chained/foo')  :CaptureArgs(1) :Chained('/') { }
sub endpoint  :PathPart('end')  :Chained('/action/chained/foo')  :Args(1) { }

#
#   Parent/child test with two args each
#
sub foo2 :PathPart('chained/foo2') :CaptureArgs(2) :Chained('/') { }
sub endpoint2 :PathPart('end2') :Chained('/action/chained/foo2') :Args(2) { }

#
#   Relative specification of parent action
#
sub bar :PathPart('chained/bar') :Chained('/') :CaptureArgs(0) { }
sub finale :PathPart('') :Chained('bar') :Args { }

#
#   three chain with concurrent endpoints
#
sub one   :PathPart('chained/one') :Chained('/')                   :CaptureArgs(1) { }
sub two   :PathPart('two')         :Chained('/action/chained/one') :CaptureArgs(2) { }
sub three_end :PathPart('three')       :Chained('two') :Args(3) { }
sub one_end   :PathPart('chained/one') :Chained('/')   :Args(1) { }

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN

sub priority_c2 :PathPart('') :Chained('priority_c1') { }
sub priority_c2_xyz :PathPart('xyz') :Chained('priority_c1')  { }


#
#   Optional specification of :Args in endpoint
#
sub opt_args :PathPart('chained/opt_args') :Chained('/') { }

#
#   Optional PathPart test -> /chained/optpp/*/opt_pathpart/*

 view all matches for this distribution


Catalyst-Engine-HTTP-Prefork

 view release on metacpan or  search on metacpan

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN


#
#   Simple parent/child action test
#
sub foo  :PathPart('chained/foo')  :CaptureArgs(1) :Chained('/') { }
sub endpoint  :PathPart('end')  :Chained('/action/chained/foo')  :Args(1) { }

#
#   Parent/child test with two args each
#
sub foo2 :PathPart('chained/foo2') :CaptureArgs(2) :Chained('/') { }
sub endpoint2 :PathPart('end2') :Chained('/action/chained/foo2') :Args(2) { }

#
#   Relative specification of parent action
#
sub bar :PathPart('chained/bar') :Chained('/') :CaptureArgs(0) { }
sub finale :PathPart('') :Chained('bar') :Args { }

#
#   three chain with concurrent endpoints
#
sub one   :PathPart('chained/one') :Chained('/')                   :CaptureArgs(1) { }
sub two   :PathPart('two')         :Chained('/action/chained/one') :CaptureArgs(2) { }
sub three_end :PathPart('three')       :Chained('two') :Args(3) { }
sub one_end   :PathPart('chained/one') :Chained('/')   :Args(1) { }

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN

sub priority_c2 :PathPart('') :Chained('priority_c1') { }
sub priority_c2_xyz :PathPart('xyz') :Chained('priority_c1')  { }


#
#   Optional specification of :Args in endpoint
#
sub opt_args :PathPart('chained/opt_args') :Chained('/') { }

#
#   Optional PathPart test -> /chained/optpp/*/opt_pathpart/*

 view all matches for this distribution


Catalyst-Manual

 view release on metacpan or  search on metacpan

lib/Catalyst/Manual/Cookbook.pod  view on Meta::CPAN

        $c->stash->{track} = $self->stash->{cd}->find_track_by_vol_and_track_no(
            $c->stash->{volume}, $track_no
        );
    }

Note that adding other actions (i.e. chain endpoints) which operate on a track
is simply a matter of adding a new sub to CD::Controller - no code is duplicated,
even though there are two different methods of looking up a track.

This technique can be expanded as needed to fulfil your requirements - for example,
if you inherit the first action of a chain from a base class, then mixing in a

 view all matches for this distribution


Catalyst-Model-Bitcoin

 view release on metacpan or  search on metacpan

lib/Catalyst/Model/Bitcoin.pm  view on Meta::CPAN

  my ($c, $arg_ref) = @_;

  croak "->config->{uri} must be set for $class\n"
    unless $self->{uri};

  $self->api( Finance::Bitcoin::API->new( endpoint => $self->{uri} ) );
  $self->wallet( Finance::Bitcoin::Wallet->new( $self->api ) );

  return $self;
}

 view all matches for this distribution


Catalyst-Model-JabberRPC

 view release on metacpan or  search on metacpan

lib/Catalyst/Helper/Model/JabberRPC.pm  view on Meta::CPAN


The same as the B<identauth> arg. passed to L<Jabber::RPC::Client>.

=item * C<jrpc.myserver.org/rpc-server>

The same as the B<endpoint> arg. passed to L<Jabber::RPC::Client>.

=back

=head1 METHODS

lib/Catalyst/Helper/Model/JabberRPC.pm  view on Meta::CPAN

Makes the JabberRPC model class.

=cut

sub mk_compclass {
    my ($self, $helper, $server, $identauth, $endpoint) = @_;

    $helper->{server} = $server || '';
    $helper->{identauth} = $identauth || '';
    $helper->{endpoint} = $endpoint || '';

    $helper->render_file('modelclass', $helper->{file});

    return 1;
}

lib/Catalyst/Helper/Model/JabberRPC.pm  view on Meta::CPAN

use base 'Catalyst::Model::JabberRPC';

__PACKAGE__->config(
    server => '[% server %]',
    identauth => '[% identauth %]',
    endpoint => '[% endpoint %]',
    # For more options take a look at L<Jabber::RPC::Client>.
);

=head1 NAME

 view all matches for this distribution


Catalyst-Plugin-ActionPaths

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/ActionPaths.pm  view on Meta::CPAN

      }
    }
    elsif (ref $dt eq 'Catalyst::DispatchType::Chained')
    {
      # taken from Catalyst::DispatchType::Chained
      ENDPOINT: foreach my $endpoint (
                    sort { $a->reverse cmp $b->reverse }
                             @{ $dt->_endpoints }
                    ) {
          my $args = $endpoint->list_extra_info->{Args};
          my @parts = (defined($endpoint->attributes->{Args}[0]) ? (("*") x $args) : '...');
          my @parents = ();
          my $parent = "DUMMY";
          my $extra  = $dt->_list_extra_http_methods($endpoint);
          my $consumes = $dt->_list_extra_consumes($endpoint);
          my $scheme = $dt->_list_extra_scheme($endpoint);
          my $curr = $endpoint;
          my $action = $endpoint;
          while ($curr) {
              if (my $cap = $curr->list_extra_info->{CaptureArgs}) {
                  unshift(@parts, (("*") x $cap));
              }
              if (my $pp = $curr->attributes->{PathPart}) {

lib/Catalyst/Plugin/ActionPaths.pm  view on Meta::CPAN

                  $name = "-> ${name}";
              }
              push(@rows, [ '', $name ]);
          }

          if($endpoint->has_args_constraints) {
            my $tc = join ',', @{$endpoint->args_constraints};
            $endpoint .= " ($tc)";
          } else {
            $endpoint .= defined($endpoint->attributes->{Args}[0]) ? " ($args)" : " (...)";
          }
          push(@rows, [ '', (@rows ? "=> " : '').($extra ? "$extra " : ''). ($scheme ? "$scheme: ":'')."/${endpoint}". ($consumes ? " :$consumes":"" ) ]);
          my @display_parts = map { $_ =~s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; decode_utf8 $_ } @parts;
          $rows[0][0] = join('/', '', @display_parts) || '/';
          $action->{path} = $rows[0][0];
          push @actions, $action;
      }

 view all matches for this distribution


Catalyst-Plugin-AutoCRUD

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


libcatalyst-plugin-autocrud-perl (0.71_02) UNRELEASED; urgency=low

  * Rename all uses of lf to cpac (legacy ListFramework references)
  * Make stash use much more polite - use cpac_* namespacing
  * Add dumpmeta_html endpoint which dumps metadata to HTML
  * Support for dispatched storage backends via site_conf backend
  * Add http_charset param to override the (new) default of utf-8
  * Filter output for HTML entities in skinny frontnend
  * DBIC ResultSource::View results in a CUD operations being disabled
  * [temporary] fix for rt.cpan #56250 Views have no primary key(s)

 view all matches for this distribution


Catalyst-Plugin-CSRFToken

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/CSRFToken.pm  view on Meta::CPAN

    integrity="sha384-..."
    crossorigin="anonymous"
  ></script>
  <script>
    $.ajax({
      url: '/some/endpoint',
      type: 'POST',
      headers: {
        'X-CSRF-Token': '[% c.csrf_token(form_id=>"your_form_id") %]'
      },
      data: {

 view all matches for this distribution


Catalyst-Plugin-CachedUriForAction

 view release on metacpan or  search on metacpan

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN

#
#   Simple parent/child action test
#
sub foo  :PathPart('chained/foo')  :CaptureArgs(1) :Chained('/') {
}
sub endpoint  :PathPart('end')  :Chained('/action/chained/foo')  :Args(1) { }

#
#   Parent/child test with two args each
#
sub foo2 :PathPart('chained/foo2') :CaptureArgs(2) :Chained('/') { }
sub endpoint2 :PathPart('end2') :Chained('/action/chained/foo2') :Args(2) { }

#
#   three chain with concurrent endpoints
#
sub one   :PathPart('chained/one') :Chained('/')                   :CaptureArgs(1) { }
sub two   :PathPart('two')         :Chained('/action/chained/one') :CaptureArgs(2) { }
sub three_end :PathPart('three')       :Chained('two') :Args(3) { }

 view all matches for this distribution


Catalyst-Plugin-CurrentComponents

 view release on metacpan or  search on metacpan

t/basic.t  view on Meta::CPAN


    sub midpoint :Chained('set_model_by_return') PathPart('') CaptureArgs(0) {
      my ($self, $c) = @_;
    }

      sub endpoint :Chained('midpoint') PathPart('') Args(0) {
        my ($self, $c) = @_;
        $c->res->body(ref $c->model);
      }

  sub set_view_by_return :Chained(/) CaptureArgs(0) {

t/basic.t  view on Meta::CPAN


    sub midpoint2 :Chained('set_view_by_return') PathPart('') CaptureArgs(0) {
      my ($self, $c) = @_;
    }

      sub endpoint2 :Chained('midpoint2') PathPart('') Args(0) {
        my ($self, $c) = @_;
        $c->res->body(ref $c->view);
      }

  package MyApp;

 view all matches for this distribution


Catalyst-Plugin-ForwardChained

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/ForwardChained.pm  view on Meta::CPAN


    # In your application class 
    use Catalyst qw/ ForwardChained /;
    
    # ... somwhere else:
    $c->forward_to_chained( [ qw/ chained endpoint /, [ qw/ args / ] );
    $c->forward_to_chained( 'chained/endpoint', [ qw/ args / ] );


=head2 Example 1

Having some controller:

lib/Catalyst/Plugin/ForwardChained.pm  view on Meta::CPAN

$VERSION = '0.03';


=head2 forward_to_chained

forwards to a certain chained action endpoint ..

    $c->forward_to_chained( "some/path", [ qw/ arg1 arg2 arg3 / ] );
    $c->forward_to_chained( [qw/ some path /], [ qw/ arg1 arg2 arg3 / ] );

=cut

lib/Catalyst/Plugin/ForwardChained.pm  view on Meta::CPAN

    return ;
}



=head2 get_chained_action_endpoints

returns array or arrayref of endpoints.. to help you find the one you need

    my @endpoints = $c->get_chained_action_endpoints;
    my $endpoints_ref = $c->get_chained_action_endpoints;

=cut

sub get_chained_action_endpoints {
    my ( $c ) = @_;
    
    my $actions_ref = $c->dispatcher->action_hash;
    my @endpoints   = 
        sort
        grep { 
            defined $actions_ref->{ $_ }->{ attributes } && 
            ref $actions_ref->{ $_ }->{ attributes }->{ Chained } 
        } 
        grep { ! /(?:^|\/)_[A-Z]+$/ } keys %{ $actions_ref }
    ;
    
    return wantarray ? @endpoints : \@endpoints;
}




 view all matches for this distribution


Catalyst-Plugin-JSONRPC

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/JSONRPC.pm  view on Meta::CPAN


=over 4

=item $c->json_rpc(%attrs)

Call this method from a controller action to set it up as a endpoint
for RPC methods in the same class.

Supported attributes:

=over 8

lib/Catalyst/Plugin/JSONRPC.pm  view on Meta::CPAN


This module uses C<Remote> attribute, which indicates that the action
can be dispatched through RPC mechanisms. You can use this C<Remote>
attribute and integrate JSON-RPC and XML-RPC together, for example:

  sub xmlrpc_endpoint : Regexp('^xml-rpc$') {
      my($self, $c) = @_;
      $c->xmlrpc;
  }

  sub jsonrpc_endpoint : Regexp('^json-rpc$') {
      my($self, $c) = @_;
      $c->json_rpc;
  }

  sub add : Remote {

 view all matches for this distribution


Catalyst-Plugin-OIDC

 view release on metacpan or  search on metacpan

t/lib/MyProviderApp/app.pl  view on Meta::CPAN


# provider server routes
get('/wellknown' => sub {
  my $c = shift;
  my %url = (
    authorization_endpoint => '/authorize',
    end_session_endpoint   => '/logout',
    token_endpoint         => '/token',
    userinfo_endpoint      => '/userinfo',
    jwks_uri               => '/jwks',
  );
  $c->render(json => {map { $_ => $url{$_} } keys %url});
});
# get '/authorize' in MyCatalystApp/Controller/Root.pm (ugly but necessary)

 view all matches for this distribution


Catalyst-Plugin-PrometheusTiny

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/PrometheusTiny.pm  view on Meta::CPAN

};

my ($prometheus,               # instance
    $ignore_path_regexp,       # set from config
    $include_action_labels,    # set from config
    $metrics_endpoint,         # set from config with default
    $no_default_controller,    # set from config
    $request_path              # derived from $metrics_endpoint
);

# for testing
sub _clear_prometheus {
    undef $prometheus;

lib/Catalyst/Plugin/PrometheusTiny.pm  view on Meta::CPAN

            $c->config->{'Plugin::PrometheusTiny'} // {}
        );

        $include_action_labels = $config->{include_action_labels};

        $metrics_endpoint = $config->{endpoint};
        if ($metrics_endpoint) {
            if ( $metrics_endpoint !~ m|^/| ) {
                Carp::croak
                  "Plugin::PrometheusTiny endpoint '$metrics_endpoint' does not begin with '/'";
            }
        }
        else {
            $metrics_endpoint = '/metrics';
        }

        $request_path = $metrics_endpoint;
        $request_path =~ s|^/||;

        $ignore_path_regexp = $config->{ignore_path_regexp};
        if ($ignore_path_regexp) {
            $ignore_path_regexp = qr/$ignore_path_regexp/

lib/Catalyst/Plugin/PrometheusTiny.pm  view on Meta::CPAN

    $class->prometheus;

    return
      if $class->config->{'Plugin::PrometheusTiny'}{no_default_controller};

    # Paranoia, as we're going to eval $metrics_endpoint
    if ( $metrics_endpoint =~ s|[^-A-Za-z0-9\._~/]||g ) {
        $class->log->warn(
            "Plugin::PrometheusTiny unsafe characters removed from endpoint");
    }

    $class->log->info(
        "Plugin::PrometheusTiny metrics endpoint installed at $metrics_endpoint"
    );

    eval qq|

        package Catalyst::Plugin::PrometheusTiny::Controller;
        use base 'Catalyst::Controller';

        sub begin : Private { }
        sub end : Private   { }

        sub metrics : Path($metrics_endpoint) Args(0) {
            my ( \$self, \$c ) = \@_;
            my \$res = \$c->res;
            \$res->content_type("text/plain");
            \$res->output( \$c->prometheus->format );
        }

lib/Catalyst/Plugin/PrometheusTiny.pm  view on Meta::CPAN

=head1 DESCRIPTION

This plugin integrates L<Prometheus::Tiny::Shared> with your L<Catalyst> app,
providing some default metrics for requests and responses, with the ability
to easily add further metrics to your app. A default controller is included
which makes the metrics available via the configured L</endpoint>, though this
can be disabled if you prefer to add your own controller action.

See L<Prometheus::Tiny> for more details of the kind of metrics supported.

The following metrics are included by default:

lib/Catalyst/Plugin/PrometheusTiny.pm  view on Meta::CPAN


Returns the C<Prometheus::Tiny::Shared> instance.

=head1 CONFIGURATION

=head2 endpoint

The endpoint from which metrics are served. Defaults to C</metrics>.

=head2 filename

It is recommended that this is set to a directory on a memory-backed
filesystem. See L<Prometheus::Tiny::Shared/filename> for details and default

lib/Catalyst/Plugin/PrometheusTiny.pm  view on Meta::CPAN


=head2 no_default_controller

    no_default_controller => 0      # default

If set to a true value then the default L</endpoint> will not be
added, and you will need to add your own controller action for exporting the
metrics. Something like:

    package MyApp::Controller::Stats;

 view all matches for this distribution


Catalyst-Plugin-ResponseFrom

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/ResponseFrom.pm  view on Meta::CPAN


1;

=head1 NAME

Catalyst::Plugin::ResponseFrom - Use the response of a public endpoint.

=head1 SYNOPSIS

    package MyApp;
    use Catalyst 'ResponseFrom';

 view all matches for this distribution


Catalyst-Plugin-Server-JSONRPC

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/Server/JSONRPC.pm  view on Meta::CPAN

  methodName: hello.world
  path      : /hello/world

From this point, it will dispatch to '/hello/world' when it exists,
like Catalyst Urls would do. What means: you will be able to set Regexes,
Paths etc on subroutines to define the endpoint.

We discuss these custom JSONRPC attributes below.

When the request is dispatched, we will return $c->stash->{jsonrpc} to the
jsonrpc client, or, when it is not available, it will return $c->stash to

 view all matches for this distribution


Catalyst-Plugin-Server

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/Server/XMLRPC.pm  view on Meta::CPAN

  methodName: hello.world
  path      : /hello/world

From this point, it will dispatch to '/hello/world' when it exists,
like Catalyst Urls would do. What means: you will be able to set Regexes,
Paths etc on subroutines to define the endpoint.

We discuss these custom XMLRPC attributes below.

When the request is dispatched, we will return $c->stash->{xmlrpc} to the
xmlrpc client, or, when it is not available, it will return $c->stash to

 view all matches for this distribution


Catalyst-Plugin-Shorten

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/Shorten.pm  view on Meta::CPAN

		$c->shorten_extract; # checks whether the shorten param exists if it does merges the stored params into the request
	}

	........

	sub endpoint :Chained('base') :PathPart('ending') :Args('0') {
		my ($self, $c) = @_;

		my $str = $c->shorten(); # returns bijection references to an ID in the store.
		my $url = $c->shorten(as_uri => 1); # return a url to the current endpoint replacing all params with localhost:300/ending?s=GH
	}

	-------

	use Catalyst qw/

 view all matches for this distribution


Catalyst-Plugin-URI

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/URI.pm  view on Meta::CPAN

    
    # V2 does its own version of named actions
    my %action_hash = %{$c->dispatcher->_action_hash||+{}};
    foreach my $key (keys %action_hash) {
      if(my ($name) = @{$action_hash{$key}->attributes->{Name}||[]}) {
        croak "You can only name endpoint actions on a chain"
          if defined$action_hash{$key}->attributes->{CaptureArgs};
        croak "Named action '$name' is already defined"
          if $c->dispatcher->_action_hash->{"/#$name"};
        $c->dispatcher->_action_hash->{"/#$name"} = $action_hash{$key};      
      }

lib/Catalyst/Plugin/URI.pm  view on Meta::CPAN

    my $url = $c->uri("#hi");

This allows you to specify the action by its name from any controller.  We don't
allow you to use the same name twice, and we also throw an exception if you attempt
to add a name to an intermediate action in a chain of actions (you can only name
an endpoint).


Lastly For ease of use if the first argument is an action object we just pass it
down to 'uri_for'.  That way you should be able to use this method for all types
of URL creation.

 view all matches for this distribution


Catalyst-Plugin-XMLRPC

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/XMLRPC.pm  view on Meta::CPAN


=head1 METHODS

=head2 $c->xmlrpc

Call this method from a controller action to set it up as a endpoint.

=cut

sub xmlrpc {
    my $c = shift;

 view all matches for this distribution


Catalyst-Runtime

 view release on metacpan or  search on metacpan

lib/Catalyst/Controller.pm  view on Meta::CPAN

            base => { Chained => '/', PathPart => '', CaptureArgs => 0 },
        },
     );

In the case above every sub in the package would be made into a Chain
endpoint with a URI the same as the sub name for each sub, chained
to the sub named C<base>. Ergo dispatch to C</example> would call the
C<base> method, then the C<example> method.

=head2 action_args

lib/Catalyst/Controller.pm  view on Meta::CPAN

See L<Catalyst::ActionRole::ConsumesContent> for more.

=head2 Scheme(...)

Allows you to specify a URI scheme for the action or action chain.  For example
you can required that a given path be C<https> or that it is a websocket endpoint
C<ws> or C<wss>.  For an action chain you may currently only have one defined
Scheme.

    package MyApp::Controller::Root;

 view all matches for this distribution


Catalyst-TraitFor-Request-ProxyBase

 view release on metacpan or  search on metacpan

lib/Catalyst/TraitFor/Request/ProxyBase.pm  view on Meta::CPAN

server what the original URI for the request was, or if the request was
initially SSL. (Yes, I do know about C<< X-Forwarded-Host >>, but they don't
do enough)

This creates an issue for someone wanting to deploy the same cluster of
application servers behind various URI endpoints.

Using this module, the request base (C<< $c->req->base >>)
is replaced with the contents of the C<< X-Request-Base >> header,
which is expected to be a full URI, for example:

 view all matches for this distribution


Catalyst-View-JSON-PerRequest

 view release on metacpan or  search on metacpan

lib/Catalyst/View/JSON/PerRequest.pm  view on Meta::CPAN

    sub midpoint :Chained(root) CaptureArgs(0) {
      my ($self, $c) = @_;
      $c->view('JSON')->data->set(y=>1);
    }

    sub endpoint :Chained(midpoint) Args(0) {
      my ($self, $c) = @_;
      $c->view('JSON')->created({
        a => 1,
        b => 2,
        c => 3,

 view all matches for this distribution


Catalyst-View-TT-Progressive

 view release on metacpan or  search on metacpan

lib/Catalyst/View/TT/Progressive.pm  view on Meta::CPAN

		};

		...
	})();

when using this approach you may want to prevent accessing of endpoints directly from a browser an easy way of achieving this is checking for a header in Root->auto and then redirecting.

        unless ($c->req->header('api')) {
                $c->response->redirect($c->uri_for('/invalid_url'));
                return;
        }

 view all matches for this distribution


Catalyst-View-Text-MicroTemplate-PerRequest

 view release on metacpan or  search on metacpan

lib/Catalyst/View/Text/MicroTemplate/PerRequest.pm  view on Meta::CPAN

    sub midpoint :Chained(root) CaptureArgs(0) {
      my ($self, $c) = @_;
      $c->view('HTML')->data->set(y=>1);
    }

    sub endpoint :Chained(midpoint) Args(0) {
      my ($self, $c) = @_;
      $c->view('JSON')->created({
        a => 1,
        b => 2,
        c => 3,
      });
    }

    # template $HOME/root/endpoint.mt
    
    This is my template
    Here's some placeholders
    a => <?= $a ?>
    b => <?= $b ?>

 view all matches for this distribution



( run in 0.858 second using v1.01-cache-2.11-cpan-2b1a40005be )