This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

How to response http post with lua
#1
I have the code below to receive an http post from external server via port 8083. After that, how can I response so the server would get the http status code 200?


Code:
local socket = require("socket")
local server = assert(socket.bind("*", 8083))
local tcp = assert(socket.tcp())

while 1 do
  local client = server:accept()
  line = client:receive()
  client:send('HTTP/1.1 200 OK \n')
end
Reply


Messages In This Thread
How to response http post with lua - by pouralise - 14.07.2021, 04:03

Forum Jump: