request.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:lantern-detection 作者: gongxijun 项目源码 文件源码
def nomethod(cls):
    """Returns a `405 Method Not Allowed` error for `cls`."""
    web.ctx.status = '405 Method Not Allowed'
    web.header('Content-Type', 'text/html')
    web.header('Allow', \
           ', '.join([method for method in \
                     ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'] \
                        if hasattr(cls, method)]))

    # commented out for the same reason redirect is
    # return output('method not allowed')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号