Skip to content

Instantly share code, notes, and snippets.

@jairojunior
Created August 14, 2020 01:48
Show Gist options
  • Save jairojunior/613bee17307f19a28993ab87721e8e9f to your computer and use it in GitHub Desktop.
Save jairojunior/613bee17307f19a28993ab87721e8e9f to your computer and use it in GitHub Desktop.
import urllib3
import json
def lambda_handler(event, context):
http = urllib3.PoolManager()
print(event)
r = http.request('POST', 'http://ip-172-31-72-37.ec2.internal/upload',
headers=event['headers'],
body=event['body'])
print(r.status)
print(r.headers)
print(r.data)
return {
'statusCode': 200,
'body': json.dumps(json.loads(r.data)),
'headers': dict(r.headers)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment