📜  如何在 Node JS 中调用 AWS Serverless api - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:09.253000             🧑  作者: Mango

代码示例1
var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://API_ID.execute-api.API_REGION.amazonaws.com/STAGE/');
xhr.onreadystatechange = function (event) {
  console.log(event.target.response);
}
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({age: 26, height: 71, income: 2100}));