Я использовал axios для собственного приложения реакции, но при реализации https.agent он показывает, что https не определен. Как это решить?
Мой код
const instance = axios.create({
httpsAgent: new https.Agent({
rejectUnauthorized: false
})
});
instance.get('https://example.com');
// At request level
const agent = new https.Agent({
rejectUnauthorized: false
});
axios.post('/practz/login', {
"username" :"orgadmin1@example.com",
"password":"exam",
"appId":"AABBCD",
"domainName":"example.com",
httpsAgent: agent
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});