+def require_POST():
+ """If the request isn't a POST request, raise 405 Method Not Allowed"""
+ if cherrypy.request.method != "POST":
+ raise cherrypy.HTTPError(405,
+ "You must submit this request with POST")
+
+cherrypy.tools.require_POST = cherrypy.Tool('on_start_resource', require_POST, priority=150)
+