import axios from 'axios'
axios.get('http://MYIP/MYURL',{
auth: {
username: 'admin',
password:'888888ov#'
}
})
.then(function (res) {
console.log(res);
/* console.log(auth);
console.log(user); */
// ... do something with the response
})
.catch(function (error) {
console.log(error);
})
.then(function () {
console.log('teste')
});
This is my code. Im connecting with this URL. The thing is, it returns me messages constantly,and i would like to get their return with axios in real time. Connect once and listen to the return from the URL in real time until i close the connection. How can i do that?