[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Read input parameters from HTML form?
- From: Sean Conner <sean@...>
- Date: Fri, 2 May 2014 19:07:44 -0400
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