Closed
Description
Use case
I am using the Router
class to setup some resolvers for use with APIGatewayHttpResolver
, and I would like to be able to set cookies in my customised Response
object, but this is not currently possible.
According to the APIGateway response documentation, the format for this is
{
"cookies" : ["cookie1", "cookie2"],
"isBase64Encoded": true|false,
"statusCode": httpStatusCode,
"headers": { "headername": "headervalue", ... },
"body": "Hello from Lambda!"
}
Solution/User Experience
Would be great to be able to just be able to do something like
return Response(
status_code=418,
cookies=["cookie1", "cookie2"],
content_type="application/json",
body=payload,
headers=custom_headers,
)
Alternative solutions
No response
Acknowledgment
- This feature request meets Lambda Powertools Tenets
- Should this be considered in other Lambda Powertools languages? i.e. Java, TypeScript