dispatch() public method

If the route match includes an "action" key, then this acts basically like a standard action controller. Otherwise, it introspects the HTTP method to determine how to handle the request, and which method to delegate to.
public dispatch ( Zend\Stdlib\RequestInterface $request, Zend\Stdlib\ResponseInterface $response = null ) : mixed | Zend\Stdlib\ResponseInterface
$request Zend\Stdlib\RequestInterface
$response Zend\Stdlib\ResponseInterface
return mixed | Zend\Stdlib\ResponseInterface
 /**
  * @override
  * dispatch
  *
  * @param RequestInterface  $request
  * @param ResponseInterface $response
  *
  * @return mixed|ResponseInterface
  */
 public function dispatch(RequestInterface $request, ResponseInterface $response = null)
 {
     $this->request = $request;
     $response = $this->getResponse();
     return parent::dispatch($request, $response);
 }