Closed sjiamnocna closed 2 years ago
$request->getRawBody()
I think you do not know how POST request and form post data works. This is not bug. POST request always send data in request body (payload). It can have any content type. But two of these content types are standard used to send form post data by browsers and these content are also parsed automatically by PHP. If you use any other non stanadard format (like json) you have to parse it yourself from raw body of post request (php://input).
Version: ?.?.?
Bug Description
JS: Fetch (AJAX) method doesn't POST data, but send it via STDIN (known bug in Fetch nobody wants to fix?) So $r->getPost() is empty in Presenter
Steps To Reproduce
Post data via Fetch with POST method and try to get POST data
Expected Behavior
Replace $_POST data by STDIN json data when using Fetch
Possible Solution
IF using Fetch (XHR) AND IF $_POST is empty, then assign
$request->post = @json_decode(file_get_contents('php://input'), true);
that will be quick fix