lua-users home
lua-l archive

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

Hi Keith,
My server does not provide a login call.  It is using HTTP basic authentication, so I guess I can use the lua HTTP to do a basic authentication to get it to the server.  Do you think that will work?
Does anyone have any code example on how to do HTTP basic authentication within a Lua client? 
I would appreciate any help on getting my lua client to work.
Thanks alot.

On Tue, Jun 3, 2008 at 9:22 PM, Keith Pimmel <> wrote:
Hi Pete,

Do you have a published API with which you're trying to interact?

As an example, I used Confluence's remote API [1] with LuaXMLRPC, and
it worked fine. The Confluence API has a login call which returns a
session id string, which is used as a key in all subsequent
interactions for that session. An example code snippet follows:

local server = 'http://localhost:8080/rpc/xmlrpc'
local user = 'admin'
local password = 'admin'
local space = 'cmt'

-- Login to confluence as user
local ok, token =,'confluence1.login','admin','admin')
if ok ~= true then
 error('Failed to connect to confluence server')

local pp = {}
ok,pp =, 'confluence1.getPage', token, space, parent)

-- etc...

Keith Pimmel