摘要:
取值 request.query_params.dict(),将querydict对象转换为字典 参考链接 https://www.jianshu.com/p/f2f73c426623 https://www.django-rest-framework.org/api-guide/requests/ 阅读全文
摘要:
如何获取请求头信息 使用如下函数request.META.get("HTTP_请求头函数"),需要注意的是,请求头变量需要全部大写。 其他注意事项如下所示: 如果headerkey为auth-token,即headers={'auth-token':'1234'} 应该使用request.META. 阅读全文
摘要:
释义 query = request.GET.get('name', '') 寻找名为name的GET参数,而且如果参数没有提交,返回一个空的字符串。 对比request.GET() 如果使用request.GET(),当获取不到name时,会导致KeyError,但是request.GET.get 阅读全文