Use __toString() instead of getContents()
Because body should be rewound before getContents().
@@ -36,7 +36,7 @@ class BodyParser
{
$data = [];
$contentType = static::getContentType($request);
- $contents = $request->getBody()->getContents();
+ $contents = (string) $request->getBody();
if ($contents) {
switch ($contentType) {
case MimeType::JSON:
