我想发布json使用cURL在Lua并附加多部分文件。尝试以下方式,但它不起作用:如何发布json与卷曲文件
local cURL = require "cURL"
c = cURL.easy{
url = "http://posttestserver.com/post.php",
post = true,
httpheader = {
"Content-Type: application/json";
};
postfields = "{}";
}
c:setopt_httppost(curl.form()
:add_file('file', recording_filename, 'audio/mp4',
filename..'.mp4', {'Content-length: ' .. fileSize}
))
c:perform()
任何帮助将是非常可观的!谢谢!
我错了JSON数据连接为HTML文件,我会尽力使这项工作。 – os11k