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.

curl to LUA
#14
(03.03.2022, 08:33)admin Wrote: Use this, adjust URL (including id parameters) as needed:
Code:
http = require('socket.http')
json = require('json')

url = 'https://exampleadr.com/pms_api/:subscription_id/:account_id/rooms/:room_id'

body = json.encode({
  room = {
    housekeeping_status = 'inspect'
  }
})

res, code = http.request({
  url = url,
  method = 'PUT',
  body = body
})

log(res, code)

The API uses Digest Auth, would the example above work in that case or would the earlier example in this thread need to be adjusted?
Reply


Messages In This Thread
curl to LUA - by KoBra - 29.12.2021, 10:41
RE: curl to LUA - by admin - 29.12.2021, 11:05
RE: curl to LUA - by KoBra - 29.12.2021, 15:18
RE: curl to LUA - by admin - 29.12.2021, 16:04
RE: curl to LUA - by KoBra - 01.01.2022, 20:30
RE: curl to LUA - by admin - 02.01.2022, 13:01
RE: curl to LUA - by KoBra - 02.01.2022, 14:05
RE: curl to LUA - by admin - 03.01.2022, 06:27
RE: curl to LUA - by KoBra - 03.01.2022, 14:26
RE: curl to LUA - by admin - 03.01.2022, 14:52
RE: curl to LUA - by KoBra - 03.01.2022, 20:43
RE: curl to LUA - by Krstfr2k - 03.03.2022, 07:08
RE: curl to LUA - by admin - 03.03.2022, 08:33
RE: curl to LUA - by Krstfr2k - 03.03.2022, 08:41
RE: curl to LUA - by admin - 03.03.2022, 09:04
RE: curl to LUA - by Krstfr2k - 04.03.2022, 12:26
RE: curl to LUA - by cekca - 27.01.2023, 13:45
RE: curl to LUA - by admin - 27.01.2023, 13:56

Forum Jump: