示例#1
0
    def enter(self, request, *args, **kwargs):

        method = request.method

        if method == 'GET':
            response = self.get(request, *args, **kwargs)
        elif method == 'POST':
            response = self.post(request, *args, **kwargs)
        elif method == 'PUT':
            response = self.post(request, *args, **kwargs)
        elif method == 'DELETE':
            response = self.delete(request, *args, **kwargs)
        elif method == 'HEAD':
            response = self.head(request, *args, **kwargs)
        elif method == 'OPTIONS':
            response = self.options(request, *args, **kwargs)
        else:
            response = method_not_allow()
        return response
示例#2
0
 def options(self, request, *args, **kwargs):
     return method_not_allow()
示例#3
0
 def head(self, request, *args, **kwargs):
     return method_not_allow()
示例#4
0
 def delete(self, request, *args, **kwargs):
     return method_not_allow()