jquery发送请求
$.ajax({
method: "POST",
headers: {
"Auth_xxx": "yes"
},
data: {},
url: "",
success: function (response) {
console.log("response data", response);
}
})
django request.META始终取不到值
request.META.get("HTTP_AUTH_XXX", "")
改正
# jquery发请求参数不要带下划线"_"
headers: {
"Auth_xxx": "yes"
},
# 修改为
headers: {
"Authxxx": "yes"
},
# request.META.get("HTTP_AUTHXXX", "")
前提是跨域部分要打开
标签:Jquery,HTTP,request,Django,headers,META,yes,response From: https://www.cnblogs.com/hkwJsxl/p/18341998