飞书官方机器人POST 请求:
{
"timestamp": "15900000001",
"sign": "xxxxxxxxxxxxxxxxxxxxx",
"msg_type": "text",
"content": {
"text": "request example"
}
}
lua :
local body = {}
table.insert(body, "timestamp=" .. tostring(time_))
table.insert(body, "&sign=" .. tostring(sign))
table.insert(body, "&msg_type=" .. "\"text\"")
table.insert(body, "&content={text=\"hello\"}")
local http = require "resty.http"
local httpc,err = http.new()
local res, err = httpc:request_uri("
https://aaa.bbb.cn",{
method = "POST",
path = "/c15f7e3a6",
body = body,
headers = {
["Content-Type"] = "application/x-www-form-urlencoded",
--["Content-Type"] = "application/json",
},
})
Response:{"msg":"params error, unknown content value"}
body:timestamp=11111111&sign=2323423sdkfjl=&msg_type="text"&content={text="hello"}