code: def request(self, method, params=None):
          
          msg_id = self._id_generator()
          log.debug('Sending request with id %s: %s %s', msg_id, method, params)
  
          message = {
              'jsonrpc': JSONRPC_VERSION,
              'id': msg_id,
              'method': method,
          }
          if params is not None:
              message['params'] = params
  
          request_future = futures.Future()
          request_future.add_done_callback(self._cancel_callback(msg_id))
  
          self._server_request_futures[msg_id] = request_future
          self._consumer(message)
  
          return request_future
docs: Send a JSON RPC request to the client.
  
          Args:
              method (str): The method name of the message to send
              params (any): The payload of the message
  
          Returns:
              Future that will resolve once a response has been received