Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access request headers in doPost()

To verify a webhook i need to get a parameter from the request headers. So far i couldn't find any information if it is actually possible to access these headers within Apps Scripts. Only thing that works so far is accessing the body of the post request.

function doPost(e) {
    // something like this
    var headerParam = e.headers['Content-Type'];
    // ...
}
like image 999
RandomDude Avatar asked Oct 15 '25 18:10

RandomDude


1 Answers

Unfortunately this is not currently possible with doPost() triggers. However there is a pending feature request for this issue on Google's issue tracker. If you'd like to see this feature supported please leave a comment (on the issue thread linked below) and be sure to STAR the issue at the following link:

https://issuetracker.google.com/issues/67764685

The workaround I currently use is to leverage Google Cloud Functions. I wrote a related article about it here.

like image 81
TheAddonDepot Avatar answered Oct 18 '25 01:10

TheAddonDepot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!