diff --git a/src/Context.php b/src/Context.php index 6285d97..613dc33 100644 --- a/src/Context.php +++ b/src/Context.php @@ -92,6 +92,6 @@ class Context */ public function getBody(): ?array { - return json_decode($this->request->getBody()->getContents(), true); + return $this->request->getParsedBody() ?: json_decode($this->request->getBody()->getContents(), true); } } diff --git a/src/Extension/Atomic.php b/src/Extension/Atomic.php index f6d4549..ea2f50f 100644 --- a/src/Extension/Atomic.php +++ b/src/Extension/Atomic.php @@ -50,7 +50,7 @@ final class Atomic extends Extension throw new MethodNotAllowedException(); } - $body = $request->getParsedBody(); + $body = $context->getBody(); $operations = $body['atomic:operations'] ?? null; if (! is_array($operations)) {