[GET]https://xxxxxx.com/api/getToken
Body : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NzkzMTM5MDB9.VgZnHxBUqR3I_PZDVSRDwuk4GfMRJShq-cda7VnBQkA"
[GET]https://xxxxxx.com/api/mail/list
header:{
"Accept": "application/json",
"Authorization": "Bearer "+Body,
}
Error: Invalid character in header content ["Authorization"]
at extractValue (D:\Documents\HBuilderProjects\test\anode\packge\node_modules\sync-rpc\lib\index.js:165:19)
at D:\Documents\HBuilderProjects\test\anode\packge\node_modules\sync-rpc\lib\index.js:175:12
at request (D:\Documents\HBuilderProjects\test\anode\packge\node_modules\sync-request\lib\index.js:28:15)
at lmail (D:\Documents\HBuilderProjects\test\anode\packge\candy.js:24:13)
at lmail (D:\Documents\HBuilderProjects\test\anode\packge\candy.js:22:37)
at Object.<anonymous> (D:\Documents\HBuilderProjects\test\anode\packge\candy.js:66:1)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'ERR_INVALID_CHAR'
}
//不知为何;打印一下header
{
Accept: 'application/json',
Authorization: 'Bearer "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NzkzMTM5MDB9.VgZnHxBUqR3I_PZDVSRDwuk4GfMRJShq-cda7VnBQkA"\n'
}
//有特殊符号 " 和 \n;
Body =Body.replace(/\"|\n/gi,'');
Error: Invalid character in header content [“Authorization“]
最新推荐文章于 2025-02-26 13:24:01 发布