我尝试用cURL在Lua中发布json。我在网上找不到任何示例。
大概是这样的:
c = curl.easy{
url = "http://posttestserver.com/post.php",
-- url = "http://httpbin.org/post",
post = true,
httppost = curl.form{
data = "{}",
type = "application/json",
},
}
t = {}
c:perform{
writefunction = function(s)
t[#t+1] = s
end
}
c:close()
1条答案
按热度按时间lmvvr0a81#
试试这个