I have a web page made with HtmlServices. This page has a form I want to submit to a GAS web app made to behave as a web service.
When I use google app script UrlFetch to call my web service from my first GAS app, I very often get a timeout. Unfortunately we cannot set the GAS UrlFetch timeout value which I think is around 10s. 10s is not enough for a GAS app to copy a file, open/edit a spreadsheet and send an email!
So I decided to use Jquery and do an ajax post (because I can set the timeout value) within my web page built with HtmlServices. (so my page is sanitized by Google Caja). Jquery is said to be supported by Caja.
But I noticed that the Ajax URL is always rewritten to be the first web app URL (the url I want to post to is changed by Caja I assume). Seems to me that Google's Caja is preventing that Ajax call. I could not find anything on Caja / Ajax post limitations within a GAS HtmlService.
Would you have suggestions on how to call a web service from a GAS Web App, without having the limitation of the GAS timeout?