flask六:四大内置对象

一.Request

 1.request属性

@first_blue.route("/get-request/")
def get_request():
    print(request.host)
    print(request.url)
    print(request.headers)
    print(request.remote_addr, request.remote_user)

    if request.method == "GET":
        return "GET"
    elif request.method == "POST":
        return "POST"
    else:
        return "not support method"

 2.request参数解析

 

2.Session

 

3.G

 

4.Config

  • 在模版中config
  • 在python代码中,app.config

posted on 2020-06-19 10:53  myworldworld  阅读(144)  评论(0)    收藏  举报

导航