Hi Jim,

Yes, this is possible by writing a custom Route subclass scoring the request
according to a given method. Then you can attach a target Restlet to your
route and then attach the route to the router:

        router.getRoutes().add(myRoute)

Otherwise you can manually check the authentication inside your Resource
methods, maybe by using a private Guard as a helper, or replicating its
logic.

Hope that helps. 

Best regards,
Jerome  

> -----Message d'origine-----
> De : news [mailto:[EMAIL PROTECTED] De la part de Jim Edwards-Hewitt
> Envoyé : mercredi 25 avril 2007 20:29
> À : [email protected]
> Objet : Routing based on URI and method
> 
> Is there a way to route requests based on the HTTP method in 
> addition to the URI
> pattern? I have a resource which requires different 
> credentials for GET and PUT,
> and I'd like to use a different Guard instance for each 
> method, rather than
> having a custom Guard class or building the check into the 
> resource class itself.
> 
> Thanks,
> 
>     -- Jim
> 

Reply via email to