Level 2
If someone have this problem, I solved using Vue.http.options.emulateJSON = true
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have an api with laravel 5.4 and here is the cors class:
public function handle($request, Closure $next)
{
return $next($request)
->header('Access-Control-Allow-Origin', '*')
->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
}
and when I try to make a request with vue-resource on my aplication
this.$http.post(apiurl,data).then(response=>{
console.log(response.body);
})
I receive that I am not allowed to cross domain.
Thanks for the help
Please or to participate in this conversation.