Lua
Lua
Example: Http.QuickGetStr method
Demonstrates theQuickGetStr method.
Chilkat Lua Downloads
local chilkat = require("chilkat")
local http = chilkat.Http.new()
-- Keep the response body if there's an error.
http.keep_response_body = true
-- Send the HTTP GET and return the content in a string.
local str = http:quick_get_str("https://www.chilkatsoft.com/helloWorld.json")
if not http.last_method_success then
if http.last_status == 0 then
-- Communications error. We did not get a response.
print(http.last_error_text)
else
print("Response status code: " .. http.last_status)
print("Response body error text:")
print(http.last_response_body)
end
return
end
print(str)
print("Success")