mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
merge from 3.3
Issue #19082: Working xmlrpc.server and xmlrpc.client examples. Both in modules and in documentation.
This commit is contained in:
commit
95be7ff911
4 changed files with 86 additions and 5 deletions
|
@ -1461,18 +1461,18 @@ if __name__ == "__main__":
|
|||
|
||||
# simple test program (from the XML-RPC specification)
|
||||
|
||||
# server = ServerProxy("http://localhost:8000") # local server
|
||||
server = ServerProxy("http://time.xmlrpc.com/RPC2")
|
||||
# local server, available from Lib/xmlrpc/server.py
|
||||
server = ServerProxy("http://localhost:8000")
|
||||
|
||||
try:
|
||||
print(server.currentTime.getCurrentTime())
|
||||
except Error as v:
|
||||
print("ERROR", v)
|
||||
|
||||
# The server at xmlrpc.com doesn't seem to support multicall anymore.
|
||||
multi = MultiCall(server)
|
||||
multi.currentTime.getCurrentTime()
|
||||
multi.currentTime.getCurrentTime()
|
||||
multi.getData()
|
||||
multi.pow(2,9)
|
||||
multi.add(1,2)
|
||||
try:
|
||||
for response in multi():
|
||||
print(response)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue