Run a google script from a node

How do I run a google script from a node?

The most obvioius way it to use the REST API via HTTP POST

Calling a google script involves a redirect (HTTP 302 moved temporarily). The redirect is not handled with the "http request" node. This is discussed on a Github issue

This works well via wget in regular bash on my Raspberry, but unfortunately the wget available in the nodred docker container results in another error (HTTP 405)

What other options do I have to invoke a google script?

  • Am I doing something wrong to invoke the HTTP request node?
  • Are there other options?

Thanks for any hint!

If you are in a position to do so, maybe you could try out the workaround in the issue...

Changing this line from

opts.followRedirect = msg.followRedirects;


opts.followAllRedirects = msg.followRedirects;

fixes it for me

You mean to change it in a function node? I've tried this

but it didn't work out

No, modify the js file as described in the issue.

Actually, what node is this? It doesn't look like the standard http request node.

What version of node-red and nodejs are you running?

First screenshot was with node-red-contrib-https

But I was also trying with the standard http node, with the suggested modification, without success

I guess I finally found the file (the link to the corresponding github repo is not valid anymore) and applied the change to 21-httprequest.js. I restarted the container, redeployed the flows, but still HTTP302

I run node-red in a docker container. Might this be an issue? My versions
NodeRed 1.2.9

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.