public function readAsJson(?IHttpBody $body): array
    {
        if ($body === null) {
            return [];
        }

        $json = json_decode($body->readAsString(), true);

        if ($json === null) {
            throw new RuntimeException('Body could not be decoded as JSON');
        }

        return $json;
    }