Skip to content

Commit

Permalink
http: Rewrite the http client to be node-like
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Phillips committed Jun 26, 2012
1 parent 43e6d4d commit 9c3d881
Show file tree
Hide file tree
Showing 10 changed files with 977 additions and 163 deletions.
10 changes: 5 additions & 5 deletions examples/http-client.lua
@@ -1,14 +1,14 @@
local http = require('http')

http.request({
local options = {
host = "luvit.io",
port = 80,
path = "/"
}, function (res)
}

local req = http.request(options, function (res)
res:on('data', function (chunk)
p("ondata", {chunk=chunk})
end)
res:on("end", function ()
res:close()
end)
end)
req:done()

0 comments on commit 9c3d881

Please sign in to comment.