lua-users home
lua-l archive

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


It was thus said that the Great Gilles Ganault once stated:
> Hello
> 
> 	I'm playing with uwsgi to call Lua scripts through CGI on an ARM
> appliance running Debian.
> 
> This works fine:
> ========== test.lua
> print("Status: 200 OK")
> print("Content-Type: text/plain\n")
> 
> print("Working fine")
> ========== 
> 
> What lightweight solutions are there to read and validate input
> parameters from HTML form through GET and POST?

  Define "lightweight".

  From a library I wrote, it appears that if you can live with just decoding
"application/x-www-form-urlencoded" then it's a few dozen lines of Lua.  To
support "multipart/form-data" as well (to handle file uploads mostly) it is
742 lines (counting what I have) of Lua and LPeg code, which could probably
be trimmed down some (I reuse code that parses email).

  -spc