PHP does not receive POST requests

Asked

Viewed 54 times

0

I have the following code in my index.php:

<?php
header('Content-type: application/json');

var_dump($_SERVER);

And I’ll file a POST request for him.

I just don’t understand why $_SERVER['REQUEST_METHOD'] is coming as GET instead of POST. I tested with other methods like PUT and DELETE and gives the same.

Requisição POST chega como GET

  • Are you using any framework? It would be Laravel?

  • I am asking this, but I will give my pinch: Generally, requests that have redirect, return GET there in the REQUEST_METHOD. I think it might be happening to you

  • No friend, I am not using any framework. In this case, how would I solve this? Have a switch in the API that looks at the ['REQUEST_METHOD'], the way it is not working right....

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.