I'm trying to send a POST request from react to PHP and this is my code:
function getPhp(){
    var xhr = new XMLHttpRequest()
    xhr.addEventListener('load', () => {
      console.log(xhr.responseText)
    })
    xhr.open('POST', 'http://localhost/anima/index.php')
    xhr.send(JSON.stringify({ dt: 'data' }))
}
PHP:
print_r($_REQUEST);
if (isset($_POST['dt'])) {
  echo $_POST['dt'];
}
However, the only response I get is
Array
(
)
Due to the $_REQUEST. I checked the network in the dev tools and everything seems fine.
 everything seems fine.
 
    