08.02.2023, 08:44
One more thing to try is to send a request using raw sockets. Modify host, uri and body as needed.
If it still does not work then check the whole raw request in Postman (starting from POST .. HTTP/1.1).
Code:
host = '192.168.0.9'
uri = '/public/test.lp'
body = 'a=b&c=d'
sock = require('socket').tcp()
sock:settimeout(5)
res, err = sock:connect(host, 80)
if res then
crlf = '\r\n'
sock:send(
'POST ' .. uri .. ' HTTP/1.1' .. crlf ..
'host: ' .. host .. crlf ..
'connection: close' .. crlf ..
'content-length: ' .. #body .. crlf .. crlf ..
body
)
res, err = sock:receive('*a')
sock:close()
log(res, err)
else
log('connect error', err)
end