我想发送一个多线程到Rtorrent Rpc而不是一些singlecalls,因此我需要知道如何格式化我的xml调用。 目前我的测试xml调用看起来像:
("<?xml version=\"1.0\"?><methodCall><methodName>system.multicall</methodName>
<params><param><value><array><data><value><struct><member><methodName>d.get_name</methodName>
<params><param><value><string>1A0AF8BB650FEFB64A6F5A800CD2770BD1658D52</string></value></param></params></member></struct></value>
<value><struct><member><methodName>d.get_bytes_done</methodName>
<params><param><value><string>1A0AF8BB650FEFB64A6F5A800CD2770BD1658D52</string></value></param></params></member></struct></value>
</param></params></methodCall>");
但我只得到这个回应:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value><struct>
<member><name>faultCode</name>
<value><i4>-503</i4></value></member>
<member><name>faultString</name>
<value><string>Call XML not a proper XML-RPC call. Call is not valid XML. Invalid XML "content". Problem with token at '</param></params></methodCall>...': mismatched tag</string></value></member>
</struct></value>
</fault>
</methodResponse>
例如,单个工作调用如下:
<?xml version=\"1.0\"?><methodCall><methodName>d.get_name</methodName>
<params><param><value><string>1A0AF8BB650FEFB64A6F5A800CD2770BD1658D52</string></value></param></params></methodCall>
我发现的唯一信息是:
system.multicall takes one argument as an array. The array contains one
or more structs with the keys methodName and params. You can add any
number of commands.
任何人都知道我做错了什么?
答案 0 :(得分:0)
<?xml version=\"1.0\"?><methodCall><methodName>system.multicall</methodName>
<params><param><value><array><data><value><struct><member><name>methodName</name><value>
<string>d.get_name</string></value></member><member><name>params</name><value><array><data><value>
<string>7CF948608C380BA6F98527A09DD441E4D3E02702</string></value></data></array></value></member>
</struct></value><value><struct><member><name>methodName</name><value><string>d.get_name</string>
</value></member><member><name>params</name><value><array><data><value>
<string>7CF948608C380BA6F98527A09DD441E4D3E02702</string></value></data></array></value></member>
</struct></value></data></array></value></param></params></methodCall>