src/JsonRpc.php
private function getJsonRequest() {
        $request = $this->getRawPostData();
        if ($request == "") {
            throw new JsonRpcExeption(101, "Parse Error: no data");
        }
        $encoding = mb_detect_encoding($request, 'auto');
        if ($encoding != 'UTF-8') {
            $request = iconv($encoding, 'UTF-8', $request);
        }
        $request = json_decode($request);
        if ($request == NULL) { // parse error
            $error = $this->getJsonError();
            throw new JsonRpcExeption(101, "Parse Error: $error");
        }
        return $request;
    }
private function getJsonRequest() {
        $request = $this->getRawPostData();
        if ($request == "") {
            throw new JsonRpcExeption(101, "Parse Error: no data");
        }
        $encoding = mb_detect_encoding($request, 'auto');
        if ($encoding != 'UTF-8') {
            $request = iconv($encoding, 'UTF-8', $request);
        }
        $request = json_decode($request);
        if ($request == NULL) { // parse error
            $error = $this->getJsonError();
            throw new JsonRpcExeption(101, "Parse Error: $error");
        }
        return $request;
    }
private function getJsonRequest ( ) { $ request = $ this -> getRawPostData ( ) ; if ( $ request == "" ) { throw new JsonRpcExeption ( 101 , "Parse Error: no data" ) ; } $ encoding = mb_detect_encoding ( $ request , 'auto' ) ; if ( $ encoding != 'UTF-8' ) { $ request = iconv ( $ encoding , 'UTF-8' , $ request ) ; } $ request = json_decode ( $ request ) ; if ( $ request == NULL ) { // parse error $ error = $ this -> getJsonError ( ) ; throw new JsonRpcExeption ( 101 , "Parse Error: $error" ) ; } return $ request ; }
get the json request
@return array
@throws JsonRpcExeption
get the json request