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
#5
(07.02.2023, 08:02)admin Wrote: Try this:
Code:
http = require('socket.http')
ltn12 = require('ltn12')

body = '{"iZoneV2Request": {"Type": 1,"No": 0,"No1": 0}}'
resp = {}

url = 'http://...'

res, code = http.request({
  url = url,
  method = 'POST',
  headers = {
    ['Content-Type']  = 'application/json',
    ['Content-Length'] = #body,
  },
  source = ltn12.source.string(body),
  sink = ltn12.sink.table(resp),
})

log(res, code, resp)

Sadly, same error

Code:
Event for 0/56/180 08.02.2023 11:24:21
* table:
[1]
  * string: {ERROR}
Reply


Messages In This Thread
RE: POST API Request not Identical to running locally - by ks04 - 08.02.2023, 00:25

Forum Jump: