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.

POST API Request not Identical to running locally
#6
One more thing to try is to send a request using raw sockets. Modify host, uri and body as needed.
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
If it still does not work then check the whole raw request in Postman (starting from POST .. HTTP/1.1).
Reply


Messages In This Thread
RE: POST API Request not Identical to running locally - by admin - 08.02.2023, 08:44

Forum Jump: