From 35d7d132d366c1b2948c804a58da3dc9790ddb76 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 6 Feb 2025 11:18:58 +0100 Subject: [PATCH] add BodyParsingMiddleware because PUT request don't have access on body data --- restapi/index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/restapi/index.php b/restapi/index.php index 75f027863..5e0d8ba61 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -3174,6 +3174,11 @@ $app->addErrorMiddleware(true, true, true); $app->add(new RestapiCorsMiddleware($container)); +/* Without the BodyParsingMiddleware the body of PUT Request will + * not be parsed in Slim4 + */ +$app->addBodyParsingMiddleware(); + // Make CORS preflighted request possible $app->options('/{routes:.+}', function ($request, $response, $args) { return $response;