This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

http.request more then 1 command in the same session
#1
How to execute more then one http request in the same web sessions?


Code:
function openDoor(iLoxxId)
  require('socket.http')
 socket.http.TIMEOUT = 5
 
  local urlLogin = 'http://'..wl_IP..'/login.cgi?Source=Webpage&Username='..wl_USR..'&Password='..wl_PWD
 local urlAccess = 'http://'..wl_IP..'/setRemoteAccess.cgi?Source=Webpage&LoxxId='..iLoxxId..'&Action=Start'
  wl_login_data = socket.http.request(urlLogin)
  log(wl_login_data)
  wl_access = socket.http.request(urlAccess)
  log(wl_access) 
end

openDoor(19)

I have a request for  login and another request for opening the door. But now i received: 401 Authorization Required

If i execute both statements in the browser it works.
Reply


Messages In This Thread
http.request more then 1 command in the same session - by gjniewenhuijse - 18.02.2019, 18:31

Forum Jump: