Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to call AWS Serverless api in Node/JS

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}));
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #call #AWS #Serverless #api
ADD COMMENT
Topic
Name
4+6 =