发布于 

MoonScript与Simple.HTTP

作者:糖果

MoonScript调用Lapis的Simple.http,其实调用的就是OpenResty的http的接口。

candylab.moon

1
2
3
4
5
6
http = require "lapis.nginx.http"
body, status_code, headers = http.simple {
url: 'http://moonscript.cn'
method: "GET"
headers: {}
}

candylab.lua

1
2
3
4
5
6
local http = require("lapis.nginx.http")
local body, status_code, headers = http.simple({
url = 'http://moonscript.cn',
method = "GET",
headers = { }
})

本站由 @anonymity 使用 Stellar 主题创建。