pagekit / vue-resource

The HTTP client for Vue.js
MIT License
10.09k stars 1.6k forks source link

HTTP req response throws net::ERR_CONNECTION_CLOSED #689

Open harishankards opened 6 years ago

harishankards commented 6 years ago

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: image

msouidi309 commented 6 years ago

Maybe trying without https ??

http://localhost:3000/students

instead of

https://localhost:3000/students
Hedoo commented 2 years ago

I had same problem, Solved with vue.config.js