Simple HTTP

下面是代码:

local http = require("lapis.nginx.http")

local app = lapis.Application()

app:get("/", function(self)
  -- a simple GET request
  local body, status_code, headers = http.simple("http://leafo.net")

  -- a post request, data table is form encoded and content-type is set to
  -- application/x-www-form-urlencoded
  http.simple("http://leafo.net/", {
    name = "leafo"
  })

  -- manual invocation of the above request
  http.simple({
    url = "http://leafo.net",
    method = "POST",
    headers = {
      ["content-type"] = "application/x-www-form-urlencoded"
    },
    body = {
      name = "leafo"
    }
  })
end)

糖果

糖果
LUA从入门到放弃

服务器大负载情况下客户端出现Connection reset by peer

服务器大负载情况下客户端出现Connection reset by peer Continue reading

Nginx+Lua中文WIKI

Published on March 14, 2019

F5收购Nginx

Published on March 12, 2019