Can I modify the HTTP response headers to add cookies and extra information? Also I'm having troubles reading the request headers.
Asked
Active
Viewed 3,552 times
6
-
Related: https://stackoverflow.com/q/47634044/1595451 – Rubén Oct 02 '19 at 04:51
1 Answers
14
You cannot read or set HTTP Headers in a Apps Script app deployed as a web app. You are restricted to reading the query string or the post values for GET/POST respectively. When responding you can only return the content and the MIME type (restricted to a few types)
This is because the scripts are served off the Google.com domain and you should not have ways to set/get cookies that could potentially be used for malicious reasons.
However, if you are using UrlFetch within an Apps Script app to make outbound calls, you have much more control of the HTTP headers

Arun Nagarajan
- 5,547
- 1
- 22
- 19
-
I'm trying to use Apps Script as Asana webhooks endpoint (https://asana.com/developers/api-reference/webhooks). So if I understand you correctly it is not possible? Here is my question: http://stackoverflow.com/questions/41357834/can-i-use-google-apps-script-as-asana-webhooks-endpoint-dopost/ Please also read my comment under the question. – Silko Dec 28 '16 at 12:38