I am running a scraping project from a headless browser using node.js and Puppeteer. I want to post the data to a Google Apps Script for further processing. I expect to see the data in my GAS project with populated parameters. But instead, I get the following result with only empty parameters.
https://script.googleusercontent.com/macros/echo?user_content_key=[key]{"parameter":{},"contextPath":"","contentLength":-1,"queryString":"","parameters":{}}
Here is the GAS code that generates that response.
Code.gsfunction doGet(e){
return handleResponse(e);
}
function doPost(e){
return handleResponse(e);
}
function handleResponse(e) {
var json = JSON.stringify(e)
var textOutput = ContentService.createTextOutput(json);
return textOutput
}
Here is the code I am using to send the request.
scraper.jsconst request = require('request');
request({
method: POST,
preambleCRLF: true,
postambleCRLF: true,
uri: postUrl,
multipart: {
chunked: false,
data,
},
},
I have verified using [RequestBin][1] that I am sending a valid POST request.
What am I doing wrong?