GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CATALYST::ACTIONROLE::SCHEME (3)

.ds Aq ’

NAME

Catalyst::ActionRole::Scheme - Match on HTTP Request Scheme

CONTENTS

SYNOPSIS



    package MyApp::Web::Controller::MyController;

    use base Catalyst::Controller;

    sub is_http :Path(scheme) Scheme(http) Args(0) {
      my ($self, $c) = @_;
      Test::More::is $c->action->scheme, http;
      $c->response->body("is_http");
    }

    sub is_https :Path(scheme) Scheme(https) Args(0)  {
      my ($self, $c) = @_;
      Test::More::is $c->action->scheme, https;
      $c->response->body("is_https");
    }

    1;



DESCRIPTION

This is an action role that lets your Catalyst::Action match on the scheme type of the request. Typically this is http or https but other common schemes that Catalyst can handle include ws and wss (web socket and web socket secure).

This also ensures that if you use uri_for on an action that specifies a match scheme, that the generated URI object sets its scheme to that automatically (rather than the scheme of the current request object, which is and remains the default behavior.)

For matching purposes, we match strings but the casing is insensitive.

REQUIRES

This role requires the following methods in the consuming class.

    match

    match_captures

Returns 1 if the action matches the existing request and zero if not.

METHODS

This role defines the following methods

    match

    match_captures

Around method modifier that return 1 if the scheme matches

    list_extra_info

Add the scheme declaration if present to the debug screen.

AUTHORS

Catalyst Contributors, see Catalyst

COPYRIGHT

See Catalyst
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CATALYST::ACTIONROLE::SCHEME (3) 2015-07-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.