AWS Lambda 関数のリクエスト

AWS Lambda 関数のリクエスト:


AWS Lambda 関数の呼び出し方法

AWS ドキュメント参照
https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/invoking-lambda-functions.html

AWS Lambda 関数のリクエスト

var xhr = new XMLHttpRequest(); 
xhr.open('GET','https://ganyf52nbe.execute-api.ap-northeast-1.amazonaws.com/dev/compare-yourself/all'); 
xhr.onreadystatechange = function(event) { 
  console.log(event.target.response); 
}  
xhr.setRequestHeader('Content-Type', 'application/json'); 
xhr.send(); 


> 結果 OK chrome で表示される


all のケース

var xhr = new XMLHttpRequest(); 
xhr.open('GET','https://ganyf52nbe.execute-api.ap-northeast-1.amazonaws.com/dev/compare-yourself/all'); 
xhr.onreadystatechange = function(event) { 
  console.log(JSON.parse(event.target.response)); 
}  
xhr.setRequestHeader('Content-Type', 'application/json'); 
xhr.send(); 


single のケース

var xhr = new XMLHttpRequest(); 
xhr.open('GET','https://ganyf52nbe.execute-api.ap-northeast-1.amazonaws.com/dev/compare-yourself/single'); 
xhr.onreadystatechange = function(event) { 
  console.log(JSON.parse(event.target.response)); 
}  
xhr.setRequestHeader('Content-Type', 'application/json'); 
xhr.send(); 
> 結果 一つのデータが表示される

コメント

このブログの人気の投稿

投稿時間:2020-07-01 05:34:30 RSSフィード2020-07-01 05:00 分まとめ(37件)

投稿時間:2020-07-01 20:43:40 RSSフィード2020-07-01 20:00 分まとめ(81件)

投稿時間:2020-07-01 08:33:22 RSSフィード2020-07-01 08:00 分まとめ(49件)