Connection: keep-alive
Content-Length: 2231
Content-Type: text/html; charset=utf-8
Date: Thu, 13 Sep 2018 07:37:46 GMT
ETag: W/"8b7-XOXhf04O/VM7yxWQ561PEgxRfz8"
x-auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1YjlhMGEyM2Q0NmI3YjFmYTQzNWI4YWIiLCJhY2Nlc3MiOiJhdXRoIiwiaWF0IjoxNTM2ODI0MjY2fQ.SAufAzjP-6vkCoaCSSGKgXTjaP5prHKZ8uFCpZmjllE
X-Powered-By: Express
在此标头中,我想将x-auth令牌存储在变量中,以便我可以进一步使用它。我该怎么办?请帮助
答案 0 :(得分:1)
请使用以下代码
$.ajax({
type: 'GET/POST',
url:'url',
data: dataformat,
success: function(data, status, req){
alert(req.getResponseHeader('headername'));
},
error: function (req, status, error) {
alert(req.getResponseHeader('headername'));
}
});
答案 1 :(得分:0)
这应该可以解决问题
apply (df, 1,
function(x) tryCatch({
t.test(x[1:3], x[4:6],alternative = "two.sided", paired = TRUE)$p.value
}, error = function(e) {NA}))