in my Micro App,
use middleware “after”,like below:
<?php
......
$app->after(function () use ($app) {
$result = $app->getReturnedValue();
if(is_array($result) || is_object($result)){
$app->response->setJsonContent($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
// must add this line
$app->response->send();
} else {
$app->response->setContent($result);
}
});
...
....
$app->handle();
?>
when my response setJsonContent(),the response must be "$app->response->send()" manual。 but when response setContent() ,it does not need use "$response->send()" method.
is it a bug?