“Laravel -API ermöglichen CORs” Code-Antworten

Laravel -API ermöglichen CORs

//I always use an easy method. Just add below lines to \public\index.php file.
//You don't have to use a middleware I think.

header('Access-Control-Allow-Origin: *');  
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
Shadow

Laravel Cors ermöglichen

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"

RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
Shadow

Laravel Api cors Localhost Problem

composer require fruitcake/laravel-cors
  
cyberjourney

Ähnliche Antworten wie “Laravel -API ermöglichen CORs”

Fragen ähnlich wie “Laravel -API ermöglichen CORs”

Weitere verwandte Antworten zu “Laravel -API ermöglichen CORs” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen