title: POST method in Google Apps Script
body: <p>May I ask what is wrong when I use the POST method in the Apps script?</p>
  
  <pre><code>function myFunctionpost() {
    var url = "mydomain.com/2spreadsheet.php";
    var data = { "testpost" :　" Text text text" };
     var payload = JSON.stringify(data);
  
   var headers = { "Accept":"application/json", 
                  "contentType" : "application/json",
                "Authorization":"Basic _authcode_"
               };
  
   var options = { "method":"POST",
               "contentType" : "application/json",
              "headers": headers,
                  "payload" : payload
             };
  
    var response = UrlFetchApp.fetch(url ,options);
    Logger.log(response );  
   }
  </code></pre>
  
  <p>The <strong><em>myFunctionpost()</em></strong> in the Apps script is about posting the Json data : "testpost" to the url.</p>
  
  <pre><code>&lt;?php
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
      echo "Server is requested";
  
      if(isset($_POST["testpost"])){
        echo "Post something here";
        echo $_POST["testpost"];
      }
  }
  </code></pre>
  
  <p>And the code in (<strong><em>2spreadsheet.php</em></strong>) showing that I want to post the data I posted, but it does not work.  </p>
  
  <p>The Loggin Output:</p>
  
  <blockquote>
    <p>[15-07-12 14:06:00:205 HKT] </p>
    
    <p>Server is requested</p>
  </blockquote>
  
  <p>Can anyone tell me what is the problem?</p>