Home  >  Q&A  >  body text

python - restful api server 中如何用装饰器来验证访问合法性

PHP中文网PHP中文网2741 days ago330

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 10:00:06

    Ugh. . Isn’t there already a plan in the information you found? Why not give it a try?

    from flask_restful import Resource
    class Foo(Resource): 
        decorators = [auth.login_required]
    
        def get(self): 
            pass 
            
        def post(self): 
            pass

    reply
    0
  • Cancelreply