I'm currently using Amazon's API Gateway to create a REST API that interacts directly with DynamoDB (using the "AWS Service" integration type - there is NO lambda in-between). Everything works, except that I'd like to return a Set-Cookie header on the first response, for use with subsequent calls to the API.
For simplicity (security is not a concern here), I'd like to use context.requestId as the cookie's value. The problem is that a Set-Cookie header requires more than just the cookie's value; at minimum it also needs a name for the cookie, in the form CookieName=CookieValue, and realistically I'd also like to set other parameters for it, such as an expiration date.
However, it seems there is no way to combine a context variable with some static text in a "header mapping value", as I'd need for the above format:
https://docs.aws.amazon.com/apigateway/latest/developerguide/request-response-data-mappings.html#mapping-response-parameters
So my question is: Is there anything I can put into the "header mapping value" box to get this behavior? Something along the lines of 'id='+context.requestId, but valid? I'd also be open to using alternative setup methods, such as the AWS CLI or importing an OpenAPI file.
For reference, this is the API Gateway input box in question:
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)