diff --git a/Handler/OnRequest.php b/Handler/OnRequest.php index 90c02c9..027d8d0 100644 --- a/Handler/OnRequest.php +++ b/Handler/OnRequest.php @@ -132,9 +132,9 @@ class OnRequest implements OnRequestInterface ->withQueryParams($request->get ?? []) ->withParsedBody(function () use ($request) { $contentType = $request->header['content-type'] ?? 'application/json'; - if (str_contains($contentType, 'json')) { - return Json::decode($request->getContent()); - } else if (str_contains($contentType, 'xml')) { + if (\str_contains($contentType, 'json')) { + return \json_decode($request->getContent(),true); + } else if (\str_contains($contentType, 'xml')) { return Xml::toArray($request->getContent()); } else { return $request->post ?? [];