def request(self, method, params=[]):
        if type(method) not in types.StringTypes:
            raise ValueError('Method name must be a string.')
        if not self.id:
            self.id = random_id()
        request = { 'id':self.id, 'method':method }
        if params:
            request['params'] = params
        if self.version >= 2:
            request['jsonrpc'] = str(self.version)
        return request
dataset/ETHPy150Open pascalw/Airplayer/airplayer/lib/jsonrpclib/jsonrpc.py/Payload.request/original