def _check_method(cls, allowed_methods=VALID_METHODS):
"""
Validate the request method is in the set of allowed methods.
If not, set the Allow header to the list of allowed methods and
return a 405 (Method Not Allowed).
"""
if cherrypy.request.method.upper() not in allowed_methods:
cherrypy.response.headers['Allow'] = (', ').join(allowed_methods)
raise cherrypy.HTTPError(405)
评论列表
文章目录