更新时间:2023-12-01 07:50:15
基本身份验证有一个 auth参数:
There is an "auth" parameter for Basic Auth:
auth: {
username: 'janedoe',
password: 's00pers3cret'
}
来源/文档: https://github.com/mzabriskie/axios
示例:
await axios.post(session_url, {}, {
auth: {
username: uname,
password: pass
}
});