From the image, it seems like it is a network error. What response does it give from postman?
Vue connecting to Laravel API
I have been watching this tutorial, and I have a problem connecting Vue application to my Laravel API. https://www.youtube.com/watch?v=vu7l574xVao&list=PL55RiY5tL51rrgq6xi67Mc6cwOHXw_nB1
I keep getting network error in browser console for posting. I can get to laravel api url, and it is working in browser and postman, but when I put that same url in vue application in axios.post I just get error, cant fix it.
this is my axios post:
axios.post('http://vue.dev/api/quote', {content: this.quoteContent}) .then( (response) => console.log(response) ) .catch( (error) => console.log(error) );
this is an error:
This is a common error. It's called CORS - Cross-Origin Resource Sharing. It's blocked by most servers as a security feature and has to be explicitly allowed to avoid getting the error. This package can help you get Laravel configured to allow it. https://github.com/barryvdh/laravel-cors
Please or to participate in this conversation.