糖果实验室杂货铺

Candy Lab

MoonScript与Simple.http

8 months ago 0

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

candylab.moon

None
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

None
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 = { }
})

糖果实验室

Openresty中文编程网
IKBC经典机械键盘
机械键盘领券优惠购买

Write a Comment