mirror of https://github.com/aria2/aria2
2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added XML-RPC code example for options. * doc/aria2c.1.txtpull/1/head
parent
d00e15179b
commit
119cf01f6c
|
@ -1,3 +1,8 @@
|
|||
2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Added XML-RPC code example for options.
|
||||
* doc/aria2c.1.txt
|
||||
|
||||
2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Added internal cross reference for sections and subsections.
|
||||
|
|
18
doc/aria2c.1
18
doc/aria2c.1
|
@ -3458,6 +3458,24 @@ In the option struct, name element is option name(without preceding "\-\-") and
|
|||
.if n \{\
|
||||
.RE
|
||||
.\}
|
||||
.sp
|
||||
Following example adds a download with 2 options: dir and header\&. header option has 2 values, so it uses a list:
|
||||
.sp
|
||||
.if n \{\
|
||||
.RS 4
|
||||
.\}
|
||||
.nf
|
||||
>>> import xmlrpclib
|
||||
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
|
||||
>>> opts = dict(dir=\*(Aq/tmp\*(Aq,
|
||||
\&.\&.\&. header=[\*(AqAccept\-Language: ja\*(Aq,
|
||||
\&.\&.\&. \*(AqAccept\-Charset: utf\-8\*(Aq])
|
||||
>>> s\&.aria2\&.addUri([\*(Aqhttp://example\&.org/file\*(Aq], opts)
|
||||
\*(Aq1\*(Aq
|
||||
.fi
|
||||
.if n \{\
|
||||
.RE
|
||||
.\}
|
||||
.SS "Sample XML\-RPC Client Code"
|
||||
.sp
|
||||
The following Ruby script adds \fIhttp://localhost/aria2\&.tar\&.bz2\fR to aria2c operated on localhost with option \fB\-\-dir\fR=\fI/downloads\fR and prints its reponse\&.
|
||||
|
|
|
@ -4088,6 +4088,18 @@ as well as string.</p></div>
|
|||
</member>
|
||||
</struct></tt></pre>
|
||||
</div></div>
|
||||
<div class="paragraph"><p>Following example adds a download with 2 options: dir and header.
|
||||
header option has 2 values, so it uses a list:</p></div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre><tt>>>> import xmlrpclib
|
||||
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
|
||||
>>> opts = dict(dir='/tmp',
|
||||
... header=['Accept-Language: ja',
|
||||
... 'Accept-Charset: utf-8'])
|
||||
>>> s.aria2.addUri(['http://example.org/file'], opts)
|
||||
'1'</tt></pre>
|
||||
</div></div>
|
||||
<h3 id="_sample_xml_rpc_client_code">Sample XML-RPC Client Code</h3><div style="clear:left"></div>
|
||||
<div class="paragraph"><p>The following Ruby script adds <em>http://localhost/aria2.tar.bz2</em> to
|
||||
aria2c operated on localhost with option <strong>--dir</strong>=<em>/downloads</em> and
|
||||
|
@ -4538,7 +4550,7 @@ files in the program, then also delete it here.</p></div>
|
|||
<div id="footnotes"><hr /></div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2010-10-30 13:03:13 JST
|
||||
Last updated 2010-10-30 13:13:28 JST
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -2136,6 +2136,18 @@ as well as string.
|
|||
</struct>
|
||||
---------------------------------------------------------------
|
||||
|
||||
Following example adds a download with 2 options: dir and header.
|
||||
header option has 2 values, so it uses a list:
|
||||
-------------------------------------------------------------------------
|
||||
>>> import xmlrpclib
|
||||
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
|
||||
>>> opts = dict(dir='/tmp',
|
||||
... header=['Accept-Language: ja',
|
||||
... 'Accept-Charset: utf-8'])
|
||||
>>> s.aria2.addUri(['http://example.org/file'], opts)
|
||||
'1'
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Sample XML-RPC Client Code
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
Loading…
Reference in New Issue