Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WouterNieuwerth/c32fbe32d1d1f577e82fd67f81e5599d to your computer and use it in GitHub Desktop.
Save WouterNieuwerth/c32fbe32d1d1f577e82fd67f81e5599d to your computer and use it in GitHub Desktop.
// Add your own Cloud Function URL here:
var CLOUDFUNCTIONSURL = 'https://europe-west1-cloud-functions-example.cloudfunctions.net/example';
var search_terms = ["buy nike shoes", "adidas online", "rebok cloths"]; // With some spelling errors
var brands = ["nike", "adidas", "reebok"];
function main() {
var json = {
"searchterms": search_terms,
"brands": brands
};
var options = {
method: 'POST',
contentType: 'application/json',
payload: JSON.stringify(json)
};
var response = UrlFetchApp.fetch(CLOUDFUNCTIONSURL, options);
Logger.log(response);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment