view http/bullet.lua @ 3:30b09b383f4e

add bullet.lua
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Wed, 29 May 2013 00:15:31 +0900
parents
children 06f22f0d9cab
line wrap: on
line source

local io = require("io")
local http = require("socket.http")
local ltn12 = require("ltn12")

local bulletURL = "http://localhost:8080/createBoard?bname=hello%20world&author=oshiro&key=0&msg=hogehoge"

b, c, h = http.request
{
--    url = bulletURL,
    url = "http://www.google.com",
    method = "GET",
--    method = "POST",
    sink = ltn12.sink.file(io.stdout)
}

print("")
print("b = "..b)
print("c = "..c)

for i,v in pairs(h) do print(i,v) end