1 Answer
- Newest
- Most votes
- Most comments
1
The HTTP request headers are available within the event
object. For example, the following code should return the requesting browser's user agent:
import json
def lambda_handler(event, context):
return {
'statusCode': 200,
'body': json.dumps(event["headers"]["user-agent"])
}
answered 2 years ago
Relevant content
- Accepted Answerasked 9 months ago
- asked 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago