2013-02-18 98 views

回答

0

所有你需要的是LuaSocket,這樣你就可以連接到你的服務器。它不一定是Tomcat服務器。嘗試運行此代碼:

local http = require "socket.http" -- import the socket.http module 
local body, httpcode, headers = http.request("http://www.google.com") 
local date = headers.date -- LuaSocket makes all header names lowercase 
print(date) --> "Mon, 18 Feb 2013 09:03:13 GMT" in my case