HTTP Basic/Digest/NTLM authentication

Login using HTTP Basic header

http.request({  
  method="GET",
  url="http://example.com/",
  headers={ ["Authorization"]= 'Basic ' .. base64.encode(username .. ':' .. password) } 
})

Login using HTTP Basic or Digest authentication

http.request_batch({
     {"GET", "http://username:password@example.com/"}
})

Login using NTLM authentication

http.request_batch({
{"GET", "http://username:password@example.com/"}
})

If you need to set a domain use the following instead:

http.request_batch({
    {"GET", "http://domain\\username:password@example.com/"}
})

See also:

Feedback and Knowledge Base