Search code examples
phppostman

Sending POST parameters with Postman doesn't work, but sending GET parameters does


I'm trying to test a simple PHP page using the Chrome extension Postman. When I send URL parameters, the script works fine (for example, the variables are available in the $_REQUEST parameter). When I send them as x-www-form-urlencoded parameters, the $_REQUEST parameter only contains the PHPSESSID.

The script:

<?php
var_export($_REQUEST);
?>

When I send URL parameters, $_REQUEST includes them:

URL parameters

But when I send them as POST variables, $_REQUEST doesn't include them:

Enter image description here

What am I missing?


Solution

  • I was setting the URL in Postman to be http://, but Apache was redirecting to https:// and somehow the POST variables were being dropped along the way.

    After I changed it to https://, the POST variables worked properly.

    See also: How to send POST variable in POSTMAN