Google apps script 如何使用气体含量服务提取柱体

Google apps script 如何使用气体含量服务提取柱体,google-apps-script,http-post,Google Apps Script,Http Post,但是如何提取POST请求的正文呢?来自 2013年5月9日 添加了以下请求的功能: 问题2158:传递给doPost()方法的请求对象现在包含POST正文。可以使用e.postData.getDataAsString()访问它 从 2013年5月9日 添加了以下请求的功能: 问题2158:传递给doPost()方法的请求对象现在包含POST正文。可以使用e.postData.getDataAsString()访问它 您可以使用事件对象的postData属性访问POST正文 在您的示例中: fu

但是如何提取POST请求的正文呢?

来自

2013年5月9日

添加了以下请求的功能: 问题2158:传递给doPost()方法的请求对象现在包含POST正文。可以使用e.postData.getDataAsString()访问它

2013年5月9日

添加了以下请求的功能: 问题2158:传递给doPost()方法的请求对象现在包含POST正文。可以使用e.postData.getDataAsString()访问它


您可以使用事件对象的postData属性访问POST正文

在您的示例中:

function doPost(request) {
  var myData= request.postData; //myData is a blob
  .
  .
  .
  return ContentService.createTextOutput(JSON.stringify(result))
  .setMimeType(ContentService.MimeType.JSON);
}
postData参数包含POST数据的blob。您可以在以下位置查看Blob上的文档:


您可以使用事件对象的postData属性访问POST正文

在您的示例中:

function doPost(request) {
  var myData= request.postData; //myData is a blob
  .
  .
  .
  return ContentService.createTextOutput(JSON.stringify(result))
  .setMimeType(ContentService.MimeType.JSON);
}
postData参数包含POST数据的blob。您可以在以下位置查看Blob上的文档: