xmlrpc with Basic Auth

M

Milos Prudek

I need to use XML-RPC call with Basic Authorization in HTTP headers. I found
xmlrpclibBasicAuth.py, and it can be used as follows:

from xmlrpclibBasicAuth import Server
s=Server("http://www.example.com/rpc.php","user","pwd")
print s.system.listMethods()

Is this possible in plain xmlrpclib, without xmlrpclibBasicAuth.py?

I found the Transport class in xmlrpclib, and it has a method "get_host_info",
which parses "user:pwd" out of "user:pwd@host". But when I tried to
instantiate Server, it threw error "unsupported XML-RPC protocol". Here is a
snippet:

from xmlrpclib import Server
s=Server("user:pwd@http://www.example.com/rpc.php")
....
File "/usr/local/lib/python2.3/xmlrpclib.py", line 1293, in __init__
raise IOError, "unsupported XML-RPC protocol"
IOError: unsupported XML-RPC protocol

I know that I am using it incorrectly. Does the basic authentication support
in xmlrpclib mean something else than I take it for?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top