0
votes

i get the following errors when gonna post something to my back-end:

Error: Network Error at createError (createError.js?2d83:16) at XMLHttpRequest.handleError (xhr.js?b50d:83)

and

POST http://192.168.137.1:8000/api/product/details net::ERR_EMPTY_RESPONSE

here is my code:

methods:{
        async postDetails(){
            if(this.notEmpty(this.details.title) && this.notEmpty(this.details.model) && this.changed){
                    let response = await this.$axios.$post('product/details', this.details)
                    console.log('product created')
                    this.changed = false
            }
        }
    }

i'm using nuxt 2.13 with @nuxt/axios 5.11.0 , and laravel 6 as my back-end and laravel is on another hosted laptop i'm also using nuxt/auth and i works perfectly!! btw in all my tries to send data via post only one time i succeeded

1
Check for CORS on laravel side. - Helper
@Helper it's already implemented via a package - Mojtaba Barari

1 Answers

0
votes

Try for CORS implementatation on Laravel end. This might be helpful:

https://medium.com/@petehouston/allow-cors-in-laravel-2b574c51d0c1.

If this doesn't help then install a package through composer.