HTTP Requests
Using Lua scripts, you can send HTTP requests as shown below.
Sending a GET Request
Server.HttpGet(url, callback)
Example)
Sending a POST Request
Server.HttpPost(url, data, callback) Example)
Receiving Data on the Web Server
When receiving a request via POST, you can print the data as shown below. You can store this data in a database like MySQL for long-term preservation.
This code is used to verify that the data sent by Server.HttpGet has successfully reached the web server. In the server script example above, the print(res)
statement outputs "1234Hellosuccess!"
.
Last updated