2

I am trying to make a post call via UrlFetchApp but when I look at my server log I see a GET call being made instead. My code looks like this

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);

Started GET "/send_sms/****" for 107.178.194.204 at 2016-06-27 12:27:41 +0530

Also I have method as post in my routes file

russ2000
  • 21
  • 3

1 Answers1

0

Maybe your POST headers require to specify the Content-Type and the Accept attributes:

var options =
{
 "method" : "post",
 "Accept" : "you accepted types"
 "Content-Type": "YOUR CONTENT TYPE HERE",
 "payload" : payload
};

Stack Overflow example

Community
  • 1
  • 1