Skip to content
Advertisement

UrlFetchApp Variable Errors

I’m trying to make a proxy with the UrlFetchApp Google Scripts API. However, with a query string of ?url="https://google.com", it gives me this error:

JavaScript

But when I substitute param in my code below for https://google.com, the exact value of param, it works perfectly fine for some reason.

Here’s my code:

JavaScript

Thank you for any help!

Advertisement

Answer

How about this modification?

I think that in your Web Apps script, the double quotes are not required.

From:

JavaScript

To:

JavaScript

or, when the URL encode is used, it becomes as follows.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement