UrlFetchApp unable to access localhost resource

前端 未结 2 639
长发绾君心
长发绾君心 2020-12-12 01:36

This works fine:

var resp = UrlFetchApp.fetch(\"someremotehost/SomeFile.csv\");
resp.getResponseCode();  //returns 200
resp.getContentText();   //returns the         


        
相关标签:
2条回答
  • 2020-12-12 01:51

    Use Proxy. I had the same issue, where my app was on AWS ec2.

    For that, I used nginx as proxy server and it worked.

    0 讨论(0)
  • 2020-12-12 01:55

    That wont work because apps script executes code server side (in google servers). The only way to do this is to make an htmlService app and use ajax from the frontend.

    0 讨论(0)
提交回复
热议问题