I'm sure there are lots of ways of doing this in LUA, using the socket libraries, socket.http, for example, but I have no experience of using any of them. There are curl bindings for LUA, there is a Debian package: https://packages.debian.org/buster/lua-curl again, I have no experience...