Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel Access to HMLHttpRequest from origin has been blocked by CORS policy: No Access-Control-Allow-Origin

public function handle($request, Closure $next)
{
    return $next($request)
        ->header('Access-Control-Allow-Origin', '*')
        ->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #Access #HMLHttpRequest #origin #blocked #CORS #No
ADD COMMENT
Topic
Name
7+1 =