With some other servers I've used there were some built in functions for parsing and retrieving the key-value pairs from an http GET or POST form submission. For instance Mako web server has a request:data() function. You just enter local name = request:data("username") or local pwd = request:data("password") to store the entered form data in a Lua script variable.
I'm not at all clear on how Litespeed communicates with a Lua script, but I am hoping it is using something similar to LSAPI. Lua is actually my first choice for scripting with Litespeed. Does anyone know how to get submitted form data from Litespeed with Lua? Apparently Apache's mod_lua has a parseargs() function for GET and a parsebody() function for POST data. They store the data in a Lua table of course. The actual syntax seems to be "r: parseargs()" with the 'r' being from "function handle(r)" although I don't know what that means. Does Litespeed use a similar system?
Python is my second choice and I would probably end up mixing Python and Lua to some degree. I guess for Python scripts Litespeed uses WSGI, but I have been googling and that fact by itself does by no means make this an easy question to answer. I can find the PEP 0333 and 3333 standard, but I am still not clear on what to do in a Python script to actually store the key:value pairs from a GET/POST request in a variable. If anyone knows the answer to this or knows a web page or even a Python book that explains it I would be very grateful for that information.
Most of the answers I've seen focus on using Django or Flask or Bottle frameworks, but I don't have the RAM for Django on my VPS and I'd like to know if Python itself has a way to do this without using a framework. After further googling it seems that straight Python just isn't suitable for web applications. It seems like using a framework with Python is not optional. So I guess I would use something like Flask or Bottle. I sort of like Bottle from what I've read so far. Will these frameworks have any problem working with Litespeed? I can use whatever method the framework has for retrieving GET/POST data as long at it is WSGI compliant?
PHP makes this trivial with $_GET, $_POST, and $_REQUEST superglobals and with a syntax like $_GET['name'] it could not get any simpler. However I would prefer to use Lua or Python if I can for various reasons. Ruby is ugh too complicated for my tiny brain.
I'm not at all clear on how Litespeed communicates with a Lua script, but I am hoping it is using something similar to LSAPI. Lua is actually my first choice for scripting with Litespeed. Does anyone know how to get submitted form data from Litespeed with Lua? Apparently Apache's mod_lua has a parseargs() function for GET and a parsebody() function for POST data. They store the data in a Lua table of course. The actual syntax seems to be "r: parseargs()" with the 'r' being from "function handle(r)" although I don't know what that means. Does Litespeed use a similar system?
Python is my second choice and I would probably end up mixing Python and Lua to some degree. I guess for Python scripts Litespeed uses WSGI, but I have been googling and that fact by itself does by no means make this an easy question to answer. I can find the PEP 0333 and 3333 standard, but I am still not clear on what to do in a Python script to actually store the key:value pairs from a GET/POST request in a variable. If anyone knows the answer to this or knows a web page or even a Python book that explains it I would be very grateful for that information.
Most of the answers I've seen focus on using Django or Flask or Bottle frameworks, but I don't have the RAM for Django on my VPS and I'd like to know if Python itself has a way to do this without using a framework. After further googling it seems that straight Python just isn't suitable for web applications. It seems like using a framework with Python is not optional. So I guess I would use something like Flask or Bottle. I sort of like Bottle from what I've read so far. Will these frameworks have any problem working with Litespeed? I can use whatever method the framework has for retrieving GET/POST data as long at it is WSGI compliant?
PHP makes this trivial with $_GET, $_POST, and $_REQUEST superglobals and with a syntax like $_GET['name'] it could not get any simpler. However I would prefer to use Lua or Python if I can for various reasons. Ruby is ugh too complicated for my tiny brain.
Last edited: