UrlFetchApp POST coding example lesson How to send data to an endpoint UrlFetchApp POST JSON

How to send data to an endpoint UrlFetchApp POST JSON Using URL fetch within Google Apps Script to connect to an endpoint, send a payload of data to the endpoint and return the response data as JSON to be used within Google Apps Script Code. Source Code https://basescripts.com/google-apps-script-coding-examples-free-pdf-downloadable-guide

1 thought on “UrlFetchApp POST coding example lesson How to send data to an endpoint UrlFetchApp POST JSON”

  1. Tested this script but gets an error on line 2 where the Urlfetchapp google.com url is.

    This the code used in google scripts

    function doGet(){
const html = getData();
//return ContentService.createTextOutput(html);
return HtmlService.createHtmlOutput(html);
}
    function getData(){
const url = ‘https://www.google.com’;
const response = UrlFetchApp.fetch(url);
return response.getContentText();
}

    Any pointers

Leave a Comment