Add in entry file
//Allowed source domains
header("Access-Control-Allow-Origin: *");
//Allowed request header information
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
//Allowed request types
header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE,OPTIONS,PATCH');
Read More:
- [Solved] has been blocked by CORS policy: Response to preflight request doesn‘t pass access control check: No
- [Solved] Request exceeded the limit of 10 internal redirects due to possible configuration error
- [Solved] yii error: Setting unknown property: yii\console\Request: :cookieValidationKey
- PHP large file upload error 413: request entity too large [How to Solve]
- [PHP] Solve the limitation of uploading files in nginx php 413 Request Entity Too Large
- [PHP] Solve the problem that the new version of Chrome’s same-site policy cannot record cookies across domains
- How to Solve phpExcel Error: ERR_INVALID_RESPONSE
- Laravel5.5 Error: SQLSTATE[42000] Syntax error or access violation 1071 Specified key was too long; max k
- [Solved] Git error: You have not concluded your merge (MERGE_HEAD exists)
- php_network_getaddresses: getaddrinfo failed (How to Fix)
- Mac: make: *** [Zend/zend_language_parser.lo] Error 1
- [Solved] TP5 Post receive array error: variable type error: array
- composer Error: The requested PHP extension ext-bcmath * is missing from your system. Install or enable
- [Solved] PHP Fatal error: Uncaught Error: Class ‘Redis‘ not found in
- Laravel-admin php artisan admin:install error reporting problem solution
- HTML + PHP inline execute JavaScript Error [How to Solve]
- [Solved] PDOException::(“SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long;
- Using $this when not in object context in (How to Fix)
- [Solved] PHP Error: Warning: file_get_contents(): Failed to enable crypto
- PHP use __Sleep() and __wakeup() method serializes the object