15 lines
378 B
Python
15 lines
378 B
Python
import requests
|
|
|
|
def main(event=None, context=None):
|
|
try:
|
|
r = requests.get('https://httpbin.org/get', timeout=3)
|
|
return {
|
|
"statusCode": 200,
|
|
"body": f"Demo OK: {r.status_code}, {r.json().get('url')}"
|
|
}
|
|
except Exception as e:
|
|
return {
|
|
"statusCode": 500,
|
|
"body": f"Error: {str(e)}"
|
|
}
|