add httpc

This commit is contained in:
Cloud Wu
2014-08-04 18:06:16 +08:00
parent 7beed39b1d
commit dec2e6fe4c
5 changed files with 276 additions and 130 deletions

16
test/testhttp.lua Normal file
View File

@@ -0,0 +1,16 @@
local skynet = require "skynet"
local httpc = require "http.httpc"
skynet.start(function()
print("GET www.baidu.com")
local header = {}
local status, body = httpc.get("baidu.com", "/", header)
print("[header] =====>")
for k,v in pairs(header) do
print(k,v)
end
print("[body] =====>", status)
print(body)
skynet.exit()
end)