Created
August 14, 2020 01:48
-
-
Save jairojunior/613bee17307f19a28993ab87721e8e9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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