Google apps script urlfetch encoding URL

前端 未结 2 1426
情书的邮戳
情书的邮戳 2021-01-17 09:27

I would like to use urlfetch to populate a spreadsheet with page data but the URL that I am trying to use is coming back with an error as an invalid argument. I think the pr

2条回答
  •  鱼传尺愫
    2021-01-17 10:14

    Try using

    baseURL + encodeURIComponent(parameterString)
    

    Where you include the parameters you're passing to the base URL you are querying as the value passed to the encodeURIComponent function. This post may be of use to you:

    Encode URL in JavaScript?

    If you encode the entire URL, like it looks like you are doing above, you're encoding more than just the parameters, which I assume would be where your problem lies.

提交回复
热议问题