lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

After I modified the module[...] line, it is working fine now.  That is a good news but I am still stuck on trying to figure out how to send the credential info to the server.  With PHP, there is something called "setCredentials($username,$password).  What is the equivalence of that in Lua?  Without the credential, I only found the call function from the doc.  Does it mean everything  I try to get data from server, I need to include the url as well?  For instance, is there anyway to create a client object and then client.send("command","parameters")?

As shown in the following, if I don't send the credential info, the server won't authorize my request.

 local ok, res = xmlrpc.http.call ("http://localhost:8080/RPC2","show")
/usr/local/share/lua/5.1/xmlrpc/http.lua:42: 1

<HTML><HEAD><TITLE>Error 401</TITLE></HEAD><BODY><H1>Error 401</H1><P>Unauthorized</P><p><HR><b><i><a href="" href="http://xmlrpc-c.sourceforge.net">http://xmlrpc-c.sourceforge.net">ABYSS Web Server for XML-RPC For C/C++</a></i></b> version Xmlrpc-c 1.14.99<br></p></BODY></HTML>
stack traceback:
    [C]: in function 'error'
    /usr/local/share/lua/5.1/xmlrpc/http.lua:42: in function 'call'
    stdin:1: in main chunk
    [C]: ?