AWS Lambda에서 array를 쿼리 스트링으로 전달하는 방법

AWS Lambda 엔드포인트에서 array를 query string을 통해 전달하면 맨 마지막 값만 사용됩

클라이언트 요청 GET my-awesome-api?a=1&a=2&a=3
실제 요청 GET my-awesome-api?a=3

공식 문서 언급에는 콤마로 구분하라고 안내한다.

When a query parameter is a list type, its value must be a string of comma-separated items. For example, GET /restapis/restapi_id/deployments/deployment_id?embed=apisummary,sdksummary.

Amazon API Gateway does not support nested query parameters of the form: GET /team?user[id]=usrid on a method request. You could work around this limitation by passing an encoded map as a single parameter and serializing it as part of a mapping template or in your back-end integration.

실수하지 말고 숙지하자!!

 Date: January 5, 2022
 Tags:  NETWORK

Previous:
⏪ [ENVIRONMENT] HEROKU에서 clearDB로 MySQL 연동하기

Next:
[NETWORK] TCP/IP를 간략하게 알아보자 ⏩