how to call aws serverless api in node 2fjs

Solutions on MaxInterview for how to call aws serverless api in node 2fjs by the best coders in the world

showing results for - "how to call aws serverless api in node 2fjs"
Carl
27 Aug 2020
1var xhr = new XMLHttpRequest();
2xhr.open('POST', 'https://API_ID.execute-api.API_REGION.amazonaws.com/STAGE/');
3xhr.onreadystatechange = function (event) {
4  console.log(event.target.response);
5}
6xhr.setRequestHeader('Content-Type', 'application/json');
7xhr.send(JSON.stringify({age: 26, height: 71, income: 2100}));