我正在尝试通过UrlFetchApp进行发布呼叫但是当我查看我的服务器日志时,我看到正在进行GET调用。我的代码看起来像这样
var payload ={
"fieldOne" : "value for field one",
"fieldTwo" : "value for field two",
"fileAttachment": "hg"
};
var options =
{
"method" : "post",
"payload" : payload
};
UrlFetchApp.fetch("http://**/send_sms/*********", options);
开始GET" / send_sms / ****" for 107.178.194.204 at 2016-06-27 12:27:41 +0530
我的路线文件
中也有帖子答案 0 :(得分:0)
也许您的POST标头需要指定Content-Type和Accept属性:
var options =
{
"method" : "post",
"Accept" : "you accepted types"
"Content-Type": "YOUR CONTENT TYPE HERE",
"payload" : payload
};