Thanks, Sean Conner,
I have updated the request and the response is in the red color, still am I missing anything?
core.Debug("actionlua called")
function check_ip(txn, addr,port)
core.Debug("actionlua called")
if not addr then addr ='3.226.158.233' end
if not port then port = 443 end
-- Set up a request to the service
local payload = [[{"email":"
evtest@yopmail.com"}]]
local hdrs = {
[1] = string.format('host: %s:%s', addr,port),
[2] = 'Accept: application/json',
[3] = 'Content-Type: application/json',
[4] = string.format('Content-Length: %d',#payload)
}
local req = {
[1] = 'POST /evl/evIDLookUp HTTP/1.1',
[2] = table.concat(hdrs, '\r\n'),
[3] = '\r\n',
[4] = payload
}
req = table.concat(req, '\r\n')
print("req::",req)
-- Use core.tcp to get an instance of the Socket class
local socket = core.tcp()
-- Connect to the service and send the request
local connection = socket:connect(addr,port)
print("connection::",connection)
-- connection:: 1local res = socket:send(req)
print("res::",res)
-- res::168local rec = socket:receive("*a")
print("rec::",rec)
-- rec:: nilend
core.register_action('checkip', {'http-req'}, check_ip)
Thanks,
B.MuraliMohanReddy