lib/DetectLanguage/Client.php
public static function request($method, $params = null)
    {
        $url = self::getUrl($method);

        $request_method = self::getRequestMethodName();
        $response_body = self::$request_method($url, $params);
        $response = json_decode($response_body);

        if (!is_object($response))
            throw new Error("Invalid server response: $response_body");

        if (isset($response->error))
            throw new Error($response->error->message);

        return $response;
    }
public static function request($method, $params = null)
    {
        $url = self::getUrl($method);

        $request_method = self::getRequestMethodName();
        $response_body = self::$request_method($url, $params);
        $response = json_decode($response_body);

        if (!is_object($response))
            throw new Error("Invalid server response: $response_body");

        if (isset($response->error))
            throw new Error($response->error->message);

        return $response;
    }
public static function request ( $ method , $ params = null ) { $ url = self :: getUrl ( $ method ) ; $ request_method = self :: getRequestMethodName ( ) ; $ response_body = self :: $ request_method ( $ url , $ params ) ; $ response = json_decode ( $ response_body ) ; if ( ! is_object ( $ response ) ) throw new Error ( "Invalid server response: $response_body" ) ; if ( isset ( $ response -> error ) ) throw new Error ( $ response -> error -> message ) ; return $ response ; }
Perform a request

@param string $method Method name
@param array $params The parameters to use for the POST body

@return object
Perform a request