I have a really strange "bug" happening right now. I have a small API where I want to handle different methods, but when sending a POST request the server handles it as GET method. Here's my code:
<?php
$C_Metodo = $_SERVER["REQUEST_METHOD"];
$N_Estado = 200;
$O_Estado = ["status" => $C_Metodo];
http_response_code($N_Estado);
echo json_encode($O_Estado);
?>
When sending a DELETE or another method the response is the right method, but when using POST it returns GET.