After 1 month, I would like to open the question regarding this topic once again: Here is the whole post with all links: https://docs.google.com/document/d/1Tb0-twzHl-wXbvaNF2IpCT0CiONT9PoqPlEweLz3oYI/edit
There is a function in a project in which a urlFetchApp sends payload, using doPost in the second script function. The second function stores the payload in the 1. spreadsheet: When running the first function, the second function does not store the payload in the spreadsheet. Detailed description below:
1. project with script
function merry2script() {
var url = 'https://script.google.com/macros/s/AKfycbzM97wKyc0en6UrqXnVZuR9KLCf-UZAEpzfzZogbYApD9KChnnM/exec';
var payload = {payloadToSend : 'string to send'};
var method = 'post'
var response = UrlFetchApp.fetch(url, {method : method, payload: payload}).getContentText();
Logger.log(response);
return;
}
img merry2.jpg
2. project with script
function doPost(e) {
var ss = SpreadsheetApp.openById("0Apjz67q9b5PldFJUYkkzVGRHdGFYc1pFYWk5T0Eyc0E");
var sheet = ss.getSheetByName("testsheet");
var record;
for (var i in e.parameters) {
record = 'parameter: ' + i + ' = ' + e.parameters[i];
sheet.getRange(sheet.getLastRow() + 1, 1, 1, 1).setValue(record);
}
var output = ContentService.createTextOutput();
output.setContent("content to return");
return output;
}
img merry_christmas.jpg
published 2. script ,
img evidence of publishing 2. script : mch1.jpg
1. spreadsheet https://docs.google.com/spreadsheet/ccc?key=0Apjz67q9b5PldFJUYkkzVGRHdGFYc1pFYWk5T0Eyc0E
Results: When the payload is sent through hurl.it(a webpage), it is not shown in the spreadsheet. trying without result
trying with this option install this chrome extension "Advanced REST Client" client/hgmloofddffdnphfgcellkdfbfbjeloo img result
result in spreadsheet ss_test.jpg