问题描述
在使用API方面我是一个初学者,最近我花了大量时间尝试使用Parse Platform API将其与我的Google Spreadsheet进行同步。我正在努力用UrlfetchApp格式化local copas = require "copas"
local http = require "copas.http"
local ltn12 = require "ltn12" -- needed to process the streams
function doRequest()
local reqbody = "isThisAGreatExample=true"
local respbody = {}
local ok,code,headers,status = http.request {
method = "POST",url = "https://httpbin.org/post",source = ltn12.source.string(reqbody),headers =
{
["Accept"] = "*/*",["Accept-Encoding"] = "gzip,deflate",["Accept-Language"] = "en-us",["Content-Type"] = "application/x-www-form-urlencoded",["content-length"] = string.len(reqbody)
},sink = ltn12.sink.table(respbody)
}
print('ok:' .. tostring(ok))
print('code:' .. tostring(code))
print('body:' .. table.concat(respbody))
end
copas.addthread(doRequest)
copas.loop()
或GET
请求。如何使用Google Apps脚本向PARSE平台REST API发出POST和GET请求?
现在我成功了,我只想分享我的脚本,以便它可以帮助其他人。 在下面查看我自己的答案
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)