Created
June 1, 2015 20:18
-
-
Save henriquegogo/863c2d1a226d20c96d60 to your computer and use it in GitHub Desktop.
Http request with lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!./bin/lua | |
local http = require('socket.http') | |
local cjson = require('cjson') | |
local response = http.request('http://www.w3schools.com/website/customers_mysql.php') | |
local customers = cjson.decode(response) | |
for i,customer in pairs(customers) do | |
print(customer.Name ..', '.. customer.City ..' - '.. customer.Country) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment