afterRequest

The function prototype

public static function afterRequest(Request $request, Response $response): void
{
}

The sample

You can trace the event to monitor the request and get the content of the response

public static function afterRequest(Request $request, Response $response): void
{
    TrackerManager::getInstance()->getTracker()->endPoint('request');

    $responseMsg = $response->getBody()->__toString();
    Logger::getInstance()->console("Response content:".$responseMsg);
    // Response status code:
    // var_dump($response->getStatusCode());

    // tracker end,After the end, you can see halfway set parameters, call stack running
    TrackerManager::getInstance()->closeTracker();
    // TODO: Implement afterAction() method.
}