vue-resource
vue-resource copied to clipboard
HTTP req response throws net::ERR_CONNECTION_CLOSED
Hi, I'm using Vue-resource for making an HTTP get request. Below is my code:
mounted () {
this.$http.get('https://localhost:3000/students', { headers: { 'content-type': 'application/json' } })
.then(function (data) {
console.log('data', data)
})
.catch(function (err) {
console.log('err', err)
})
}
I checked with postman, it gives the right response. But in browser, I get the below error response:
Maybe trying without https ??
http://localhost:3000/students
instead of
https://localhost:3000/students
I had same problem, Solved with vue.config.js