在 python 中,调用 XML-RPC 方法涉及调用代理对象上的方法:
from xmlrpclib import ServerProxy
print ServerProxy('https://example.com/rpc').api.hello_there('John')
在其他一些语言中,例如 perl,您将方法名称作为方法参数传递。
use Frontier::Client;
$p = Frontier::Client->new(url => 'https://example.com/rpc');
$result = $p->call('api.hello_there', 'John');
print $result;
有没有办法在 Python 中按名称(作为字符串)调用 XML-RPC 方法?