0

I have two google scripts:

1) Script A with url say sa/exec which accepts parameters a,b,c

2) Script B with url say sb/exec

I have to call doGet(e) of script A from script B. Manually I can do it by typing in browser like sa/exec?a=vala&b=valb&c=valc. And in google script, I can do it like this:

var params={
  'method':'get',
  'payload':'a=vala&b=valb&c=valc'
};
JSON.stringify(UrlFetchApp.fetch(url, params));

But its a very error prone way as we have to escape the special characters manually and also take care of url encoding in the payload. So is there something like Url builder which can come to aid in this situation and save my time and effort?

1 Answer 1

1

Use encodeURI() or encodeURIComponent().

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.