ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-mod_perl
perl-mod_perl
Re: Handler Chain (based on request method)
by Perrin Harkins other posts by this author
Oct 28 2009 11:07AM messages near this date
Handler Chain (based on request method) | Re: Handler Chain (based on request method)
On Wed, Oct 28, 2009 at 12:58 PM, Aaron Dalton <aaron@[...].ca>  wrote:
>  I'm using mod_perl and CGI::Application::Dispatch to create a RESTful
>  web application.  In the one resource, GETs should be sent to the
>  default handler, and all other requests to the dispatcher.  I have tried
>  using <Limit> and <LimitExcept>, but they do not appear to be working.

Those are for rejecting requests, not mapping them to handlers.  I
would either use mod_rewrite to map the GET requests to a different
location, or make a PerlTransHandler to deal with it.

>  Do I need to write some sort of
>  pre-dispatcher that checks the request method and returns DECLINED if
>  it's GET?

Right, that would be the TransHandler approach.

>  But if it's *not* GET, how do I then pass control on to the
>  other dispatcher?

You can set the handler for the current request from within the
script.  Take a look at the docs for examples.  I know you'll find
some if you search for "default-handler" in the mail archives too.

- Perrin
Thread:
Aaron Dalton
Perrin Harkins
aw
aw

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved