Reputation: 702
I have a Google Apps Script that is supposed to receive and process base64-encoded data. Sending CORS GET requests to it works well, but the data strings are too long to be sent as GET parameters, so I have to send it in CORS POST requests. Unfortunately, all POST requests to the script gets HTTP 405 and does not include the access-control-allow-origin:*
-header.
This is an excerpt of my current server side script:
function doGet(e) {
// Irrelevant because GET requests works fine
}
function doPost(e) {
// Doesn't work:
Logger.log(e);
return ContentService.createTextOutput("It works!");
}
I am using angularJS on the client side to send the requests, here is a screenshot from Chrome of a request:
Is there anything I can do to fix this?
Upvotes: 1
Views: 1810
Reputation: 702
For some reason it got solved when I added the header Content-Type: undefined
to the request.
Upvotes: 1