title: Unable to send POST request to Google Apps Script
body: <p>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 <code>access-control-allow-origin:*</code>-header.</p>
  
  <p>This is an excerpt of my current server side script:</p>
  
  <pre><code>function doGet(e) {
     // Irrelevant because GET requests works fine
  }
  
  function doPost(e) {
    // Doesn't work:
  
    Logger.log(e);
    return ContentService.createTextOutput("It works!");
  }
  </code></pre>
  
  <p>I am using angularJS on the client side to send the requests, here is a screenshot from Chrome of a request:
  <a href="https://i.stack.imgur.com/eqrQe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eqrQe.png" alt="enter image description here"></a></p>
  
  <p>Is there anything I can do to fix this?</p>