I'm new to Lua and only picked it up after I found out you can use Lua to add scripts to the game Zoo Tycoon 2. However, Zoo Tycoon 2 uses Lua version 5.0.2 and I haven't managed to get LuaRocks to work with Lua 5.0.
I tried it with LuaSocket for Lua 5.1, but it didn't work and I don't know what went wrong, as I don't know when my script throws exceptions because the game doesn't give me feedback other than what my script was supposed to do not happening. I've tried logging to a console window or a file, but that didn't work either, but that might be something for another question.
I've looked at How to HTTP POST in Lua without using Lua Socket but I couldn't find documentation on the tcpConnect()
, tcpSend()
and tcpClose()
functions used there and I don't know where those come from or if they are compatible with Lua 5.0.
I think it's probably the best for me to have as little dependencies as possible. So, I was wondering, how do you send a HTTP POST request in Lua 5.0?