Lua
Lua
Shopify Basic Authentication: Get List of Products
See more Shopify Examples
Demonstrates how to send a simple HTTP GET request with Basic authentication to get a list of products.Chilkat Lua Downloads
local chilkat = require("chilkat")
-- This example requires the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
local http = chilkat.Http.new()
-- Use your Shopify store's Admin API key and password.
http.login = "admin3_api_key"
http.password = "admin3_password"
http.basic_auth = true
local jsonStr = http:quick_get_str("https://mystore.myshopify.com/admin/api/2020-07/products.json")
if not http.last_method_success then
print(http.last_error_text)
return
end
print("Response status code: " .. http.last_status)
print("JSON response:")
print(jsonStr)