- Added basic handling of BODY content from Web-RestMethod from PS

This commit is contained in:
Dave Mc Nicoll 2022-05-11 14:09:18 +00:00
parent 83fee32ac0
commit ceebc6783a
1 changed files with 12 additions and 4 deletions

View File

@ -35,6 +35,14 @@ class FormContext implements FormContextInterface
$this->values = $request->getParsedBody() ?: [];
if ( ! $this->values ) {
$content = utf8_encode((string) $request->getBody());
if ( $content && ( $json = json_decode($content, true) ) ) {
$this->values = $json;
}
}
$this->files = $request->getUploadedFiles() ?: [];
}