This commit is contained in:
2023-10-08 15:33:14 +08:00
parent 1dd7fe5bb8
commit 4ea8a8c2e4
+14 -1
View File
@@ -35,7 +35,7 @@ class Request implements ServerRequestInterface
public function __construct()
{
$this->middlewares = \config('request.middlewares', []);
$this->exception = \config('request.exception', ExceptionHandlerDispatcher::class);
$this->exception = \config('request.exception', ExceptionHandlerDispatcher::class);
}
@@ -310,6 +310,19 @@ class Request implements ServerRequestInterface
return $this->__call__(__FUNCTION__, $name);
}
/**
* @return array
*/
public function all(): array
{
$data = $this->getParsedBody();
if (is_array($data)) {
return $data;
}
return [];
}
/**
* Gets the body of the message.
*