Bug #74438 [NEW]: $_REQUEST/$_POST not populated
| From: | ulimetic at hotmail dot com | Date: | Fri, 14 Apr 2017 11:23:06 +0000 |
| Subject: | Bug #74438 [NEW]: $_REQUEST/$_POST not populated | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-208545@lists.php.net to get a copy of this message | ||
From: ulimetic at hotmail dot com
Operating system: Win 7 x64
PHP version: 7.1.4
Package: *General Issues
Bug Type: Bug
Bug description:$_REQUEST/$_POST not populated
Description:
------------
From client in CURL:
$ch = curl_init();
$data = '{"test":"hello"}';
curl_setopt($ch, CURLOPT_URL, 'http://localhost');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json',
'Content-Length: '.strlen($data)]);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);
var_dump($output);
curl_close($ch);
From server
var_dump($_SERVER["CONTENT_TYPE"], $_REQUEST, $_POST);
//"string(16) "application/json" array(0) { } array(0) { } "
But file_get_contents("php://input") is populated
Tied the same with an Ajax call and the result is identical
--
Edit bug report at https://bugs.php.net/bug.php?id=74438&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74438&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74438&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74438&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74438&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74438&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74438&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74438&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74438&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74438&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74438&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74438&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74438&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74438&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74438&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74438&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74438&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74438&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74438&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74438&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74438&r=mysqlcfg