request对象的方法

request对象的方法

request.method  # 请求方法 GET POST 
request.GET     # url上携带的参数  {}  
request.POST   # form提交POST请求的参数  {}   编码类型是urlencode 
request.body   # 请求体  b''
request.path_info  # 路径  不包含ip和端口  也不包含参数
request.COOKIES  # cookie的字典 
request.session  # session的数据
request.FILES  # 上传的文件  编码的类型是  enctype="multipart/form-data"
request.META     # 请求头   小写 ——》 大写  HTTP_    - _> _

request.get_full_path()   # 路径  不包含ip和端口  包含参数
request.get_signed_cookie(key)  # 获取加密cookie
request.is_ajax()   # 是否是ajax
原文地址:https://www.cnblogs.com/-xct/p/12080622.html