def method_check(self, request, allowed=None):
        if allowed is None:
            allowed = []

        request_method = request.method.lower()

        if request_method == "options":
            allows = ','.join(map(str.upper, allowed))
            response = HttpResponse(allows)
            response['Allow'] = allows
            raise ImmediateHttpResponse(response=response)

        if not request_method in allowed:
            raise ImmediateHttpResponse(response=http.HttpMethodNotAllowed())

        return request_method
Ensures that the HTTP method used on the request is allowed to be
dataset/ETHPy150Open toastdriven/piecrust/piecrust/resources.py/Resource.method_check