CLOUD/Public Cloud
[AWS] API Gateway : POST
alsruds
2023. 3. 17. 04:20
[ POST 방식으로 Lambda 함수 불러오기 ]
● lambda 함수 생성
》 AWS 》 Lambda
● API Gateway 생성
》 AWS 》 API Gateway 》 API 생성 》 REST API
● Resource 생성
》 Resources 》 Actions 》 Create Resources 》 Create Method : POST
》 Lambda Function : 만든 함수 연결
● Method Request
》 Request Body 》 Add model
》 Content type : application/json
》 Model name : Empty
● Integration Request
》 Mapping Templates 》 Add mapping template
》 Request body passthrough : When there are no template defined
》 Content-Type : application json
》 Generate Template :
{
"body-json" : $input.json('$')
}
● TEST
● 배포
》 Resources 》 Actions 》 Deploy API
● Post 방식 확인하는 법
① postman 프로그램 사용
② cmd 창에서 명령어 입력
curl -XPOST [invoke url/resource명] -H "Content-Type: application/json" -d [request body]