'
Find config.inc
file under C:\wamp\apps\phpmyadmin3.5.1
Inside this file find this one line
$cfg['Servers'][$i]['password'] =";
and replace it with
$cfg['Servers'][$i]['password'] = 'Type your root password here';
'
Find config.inc
file under C:\wamp\apps\phpmyadmin3.5.1
Inside this file find this one line
$cfg['Servers'][$i]['password'] =";
and replace it with
$cfg['Servers'][$i]['password'] = 'Type your root password here';
A simple way to ask PHP to disable reporting of notices is to put a line of code at the beginning of the PHP page.
<?php error_reporting (E_ALL ^ E_NOTICE); ?>
Or you can add the following code which stops all the error reporting,
<?php error_reporting(0); ?>
Php.ini is a configuration file and is essential for all the programs running on PHP. Open this file and find the field error_reporting. The easiest way is to use the ctrl + F shortcut key. By default, error reporting is set to E_ALL. That means all errors are reported. Change this to E_ALL & ~E_NOTICE. It means all errors except for the notices will now be reported.
Answer:
The preflight is being triggered by your Content-Type of application/json
. The simplest way to prevent this is to set the Content-Type to be text/plain
in your case. application/x-www-form-urlencoded
& multipart/form-data
Content-Types are also acceptable, but you'll of course need to format your request payload appropriately.
If you are still seeing a preflight after making this change, then Angular may be adding an X-header to the request as well.
Or you might have headers (Authorization, Cache-Control...) that will trigger it, see:
----
Unlike simple requests, for "preflighted" requests the browser first sends an HTTP request using the OPTIONS
method to the resource on the other origin, in order to determine if the actual request is safe to send. Such cross-origin requests are preflighted since they may have implications for user data.
The following is an example of a request that will be preflighted:
const xhr = new XMLHttpRequest();
xhr.open("POST", "https://bar.other/doc");
xhr.setRequestHeader("X-PINGOTHER", "pingpong");
xhr.setRequestHeader("Content-Type", "text/xml");
xhr.onreadystatechange = handler;
xhr.send("<person><name>Arun</name></person>");
The example above creates an XML body to send with the POST
request. Also, a non-standard HTTP X-PINGOTHER
request header is set. Such headers are not part of HTTP/1.1, but are generally useful to web applications. Since the request uses a Content-Type
of text/xml
, and since a custom header is set, this request is preflighted.
Solution 1 - you need to change your backend to accept your incoming requests
Solution 2 - using Angular proxy see here
Please note this is only for
ng serve
, you can't use proxy inng build
Solution 3 - IF your backend accepts requests from a wildcard domanin like *.testdomain.example
then you can edit your hosts
file and add 127.0.0.1 local.testdomain.example
in there, then in your browser instead of localhost:4200
enter local.testdomain.example:4200
Note: the reason it's working via postman is postman doesn't send preflight requests while your browser does.
CPU vs GPU Architecture CPU (Central Processing Unit) and GPU (Graphics Processing Unit) have distinct architectural differences, optimize...