HTTP redirect using lambda handler

From wikieduonline
Revision as of 10:40, 21 June 2023 by Welcome (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 def lambda_handler(event, context):
 
     # Generate HTTP redirect response with 302 status code and Location header.
     
     response = {
         'status': '302',
         'statusDescription': 'Found',
         'headers': {
             'location': [{
                 'key': 'Location',
                 'value': 'http://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html'
             }]
         }
     }
     
     return response

Related[edit]

See also[edit]

Advertising: