请注意,这是 Roblox 的 lua 版本。我想将表格上传到 Pastebin。这是我为 Pastebin 准备的。
h = game:GetService'HttpService'
JSON = h:JSONEncode(ImgScript) --ImgScript is a table formatted like {{x,y,z}, {x,y,z}, {x,y,z}, etc.}
h:PostAsync('http://pastebin.com/api/api_post.php','&api_dev_key=CensoredDevKey&api_option=paste&api_paste_code=' .. JSON)
这不起作用,我似乎无法弄清楚为什么。
编辑:我也试过这个,它没有用。
h = game:GetService'HttpService'
api_params = {
["api_dev_key"] = "CensoredDevKey",
["api_option"] = "paste",
["api_paste_code"] = ImgScript
}
api_params = h:JSONEncode(api_params)
h:PostAsync('http://www.pastebin.com/api/api_post.php', api_params)
编辑:我也试过这个,但没有奏效:
h = game:GetService'HttpService'
JSON = h:JSONEncode(ImgScript) --ImgScript is a table formatted like {{x,y,z}, {x,y,z}, {x,y,z}, etc.}
data = h:UrlEncode('&api_dev_key=CensoredDevKey&api_option=paste&api_paste_code=' .. JSON)
h:PostAsync('http://pastebin.com/api/api_post.php', data)