public function __index() { $request = @json_decode(\Gini\CGI::content(), true); if ($request === null) { $response = ['jsonrpc' => '2.0', 'error' => ['code' => -32700, 'message' => 'Parse error'], 'id' => $id]; } else { $response = \Gini\API::dispatch((array) $request); } return \Gini\IoC::construct('\\Gini\\CGI\\Response\\JSON', $response); }
private function _testCall($method, $params) { $apiData = ['jsonrpc' => '2.0', 'method' => $method, 'params' => $params, 'id' => uniqid()]; $response = \Gini\API::dispatch($apiData); $this->assertSame($params[0], $response['result'], 'call ' . $method); }