【发布时间】:2020-08-05 17:27:25
【问题描述】:
有没有一种简单的方法可以在 Axios 中禁用 SSL 验证。我试过这个process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';,但它不起作用。
这是我的代码示例”
const postPosts = () => {
axios
.post("https://xxx.dev.lab", {
Username: "xxx",
Password: "xxx"
})
.then(response => {
console.log(response);
})
.catch(error => {
console.error(error);
});
};
postPosts();
【问题讨论】:
标签: javascript axios