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

Example: Http.HttpNoBody method

Demonstrates how to use the HttpNoBody method to send HTTP requests without a request body (e.g., GET, DELETE, HEAD) and receive the response in a Chilkat Http response object.

Chilkat Lua Downloads

Lua
local chilkat = require("chilkat")

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

-- Send a DELETE request to https://api.example.com/users/123
local url = "https://api.example.com/users/123"
local success = http:http_no_body("DELETE", url, resp)
if not success then
    print(http.last_error_text)
    return
end

print("Response Status Code: " .. resp.status_code)
print("Response body:")
print(resp.body_str)