Calling URI * */ public function __construct($matches){ /* (1) Rebuild request url */ $uri = $matches['uri']; /* (2) Creates request */ $this->request = Loader::remote($uri); } /* CALL * */ public function call(){ /* (1) Process response */ $this->response = $this->request->dispatch(); /* (2) Manages result */ if( $this->response instanceof Response ){ header('Content-Type: application/json'); echo $this->response->serialize(); } return true; } /* POST-CALL * */ public function __destruct(){ } }