I have an endpoint to update a given entity, and the response should be the updated entity. I hterefore tried the following, however, the redirect is another PUT request. How do I respond with a GET request?
$app->put('/foo/{id:[0-9]+}', function (Request $request, Response $response, $args) {
$this->foo->update($args['id'], $request->getParsedBody());
return $response->withRedirect("/foo/$args[id]");
});