raw = file_get_contents('php://input'); // This is a workaround for where php://input has already been read. // See note under php://input on https://www.php.net/manual/en/wrappers.php.php if (empty($this->raw) && isset($GLOBALS['HTTP_RAW_POST_DATA'])) { $this->raw = $GLOBALS['HTTP_RAW_POST_DATA']; } $source = json_decode($this->raw, true); if (!\is_array($source)) { $source = []; } } parent::__construct($source, $options); } /** * Gets the raw JSON string from the request. * * @return string The raw JSON string from the request. * * @since 1.0 */ public function getRaw() { return $this->raw; } }