Cross-domain requests stopped working due to no `Access-Control-Allow-Origin` header present in the response

后端 未结 5 1436
迷失自我
迷失自我 2020-11-30 02:17

I have an error reporting beacon I created using Google Apps script and it is published to run as myself and to be accessible to "anyone, even anonymous," which

5条回答
  •  长情又很酷
    2020-11-30 02:30

    Just to make it simpler for those who are only interested in a POST request like me:

    function doPost(e){
    
     //do stuff ...
    
     var MyResponse = "It Works!";
    
     return ContentService.createTextOutput(MyResponse).setMimeType(ContentService.MimeType.JAVASCRIPT);
    
    }
    

提交回复
热议问题