$arguments = array(); switch ($this->method) { case 'put': case 'delete': parse_str(file_get_contents('php://input'), $arguments); break; case 'post': $arguments = $_POST; break; case 'get': default: $arguments = $_GET; } $this->arguments = $arguments; } /** * Dispatches the request * * @author KnowledgeTree Team * @access public */ public function handle() { $this->response->_dispatch($this->method, $this->arguments); $this->response->output(); } } // Instantiate the webservice $ws = new WebService(); $ws->handle(); exit;