@allow_methods decorator

The @allow_methods decorator when applied to the dispatch method works like a filter to specified HTTP methods

Example

1
2
3
4
5
6
7
from zunzuncito import tools

class APIResource(object):

    @tools.allow_methods('post, put')
    def dispatch(self, request, response):
        """ your code goes here """

In this case all the request that are not POST or PUT will be rejected

Many thanks Paw - The ultimate REST client for Mac. for supporting Open Source projects.

paw

A great amount of time has been spent creating, crafting and maintaining this software, please consider donating.

Donating helps ensure continued support, development and availability.

dalmp


comments powered by Disqus