Lua/WebDevelopment - How to get URL variables?

2019-07-25 11:17发布

I'm using Lua for web development.

How do I retrieve URL (get) variables?


For example http://example.com/?varA=999

Psuedo Lua code:

local varA = url.get(varA);  -- varA = 

标签: url lua
2条回答
\"骚年 ilove
2楼-- · 2019-07-25 11:48

If you are running your Lua code in Lua, you can use request_path() and request_uri() to read the URL, and global _GET for a parsed version that correspond to the URL get variables you mention.

查看更多
冷血范
3楼-- · 2019-07-25 12:03

Lua's standard library doesn't do networking. Check out LuaSocket.

查看更多
登录 后发表回答