Horje
access control allow headers Code Example
access control allow headers
Access-Control-Allow-Origin: http://foo.example
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: X-PINGOTHER, Content-Type
Access-Control-Max-Age: 86400
Access to XMLHttpRequest at 'http://localhost/MySQL_pracs/InsertUser.php' from origin 'http://localhost:4200' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.
//Access to XMLHttpRequest at 'http://localhost/[api path].php' from origin 'http://localhost:4200' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.

//The error is simply saying that "Content-Type" is missing from "Access-Control-Allow-Headers".

//Therefore we need to add "Content-Type" to "Access-Control-Allow-Headers".

<?php 
header('Access-Control-Allow-Headers: Content-Type');
-----
?>
Source: github.com




Whatever

Related
apa referencing website Code Example apa referencing website Code Example
code .is not recognized as an internal or external command Code Example code .is not recognized as an internal or external command Code Example
flutter squared avatar rounded borders Code Example flutter squared avatar rounded borders Code Example
dom full form Code Example dom full form Code Example
min max font size Code Example min max font size Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8