I am facing a strange issue with a lambda intergration in api gateway ( tried proxy as well same issue)
lambda first hits AppSync and returns either JSON content on error or a XLXS file on success.
while testing on API gateway test console it brings back status 200 and the binary results as expected. but when i try it externally through postman it fails.
More info :
Intergration type : Lambda
Success response :
response = buffer.toString("base64");
Error Response:
response= JSON.stringify(err);
Serverless apigateway setup:
exportXls:
handler: ./src/apiGatewayLambdas/exportxls/exportXls.handler
role: AppSyncLambdaRole
events:
- http:
path: /api/exportxls
method: post
integration: lambda
contentHandling: CONVERT_TO_BINARY