I am very new to Catalyst and just starting to build a web application to learn some things.
One thing that I haven't figured out is how to limit requests to a specific POST controller method (for example).
A specific example is a query that initiates the creation of an object in a database. Since I want this application to be fairly strict regarding REST verbs, this should only be possible through POST.
I know that I can use the $ C-> method to check the method used in the request and return an error or something like that if I don't find what I'm looking for, but I was hoping there was ... a cleaner way .
Now i have something like
sub create :Local :Args(0) { ... }
Am I doomed to check a method inside a routine and do this for each method?
Please keep in mind that I am extremely new to Catalyst, so this might be a dumb question.
Thanks for the help!
source share