daurnimator
October 2017
Every application lua gets embedded in implements their own new (non-feature complete) network protocol libraries
:method
, :path
:status
nil, err_msg, errno
on failure:unget
back into socket for retrylocal http_request = require "http.request"
local my_req = http_request.new_from_uri("http://httpbin.org/get")
local headers, stream = assert(my_req:go())
for field, value in headers:each() do
print(field, value)
end
local body = assert(stream:get_body_as_string())
print(body)
The client module is good for use anywhere today.
The server module has a couple of issues left before it should be used on the wide-open internet.
e.g. Support for MAX_CONCURRENT_STREAMS
is needed to prevent resource exhaustion for a http2 server.
Homepage: https://github.com/daurnimator/lua-http/