Hi there,
Is there some way to make an HTTP request in a Lua script?
Or is there a better way to communicate with servers?
Do you mean
-- importing HTTP package
local http = require("http")
-- making HTTP call
response, err = http.request("GET", "https://example.com")
if err then error(err) end
I already found this library.
But I can’t import http. Do I have to install normal lua to then install the package?
A more modern solution is to use lua-http: GitHub - daurnimator/lua-http: HTTP Library for Lua. Supports HTTP(S) 1.0, 1.1 and 2.0; client and server.
It comes with a luasocket/luasec compatible interface.