Sample code for 30+ languages & platforms
Lua Requires Chilkat v11.0.0+

Example: Http.GetLastJsonData method

Demonstrates the GetLastJsonData method.

Chilkat Lua Downloads

Lua
local chilkat = require("chilkat")

local http = chilkat.Http.new()
local resp = chilkat.HttpResponse.new()

-- Only allow TLS 1.2 or better.
http.ssl_protocol = "TLS 1.2 or higher"

local success = http:http_no_body("GET", "https://google.com/", resp)
if not success then
    print(http.last_error_text)
    return
end

local json = chilkat.JsonObject.new()
json.emit_compact = false

http:get_last_json_data(json)
print(json:emit())

-- Output as of Chilkat v11.1.0
-- Additional information may be added as requested or needed in future versions of Chilkat.

-- {
--   "tls": {
--     "params": {
--       "sniHostname": "www.google.com",
--       "allowConnectionOnlyIfServerChooses": "TLS 1.2 or higher"
--     },
--     "negotiatedTlsVersion": "TLS 1.3"
--   }
-- }