Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use requests for python sample app #280

Merged
merged 2 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions python/sample-apps/function/lambda_function.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
import os
import json
import aiohttp
import asyncio
import boto3


async def fetch(session, url):
async with session.get(url) as response:
return await response.text()


async def callAioHttp():
async with aiohttp.ClientSession() as session:
html = await fetch(session, "http://httpbin.org/")
import requests

s3 = boto3.resource("s3")

# lambda function
def lambda_handler(event, context):

loop = asyncio.get_event_loop()
loop.run_until_complete(callAioHttp())
requests.get("http://httpbin.org/")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https?


for bucket in s3.buckets.all():
print(bucket.name)
Expand Down
2 changes: 1 addition & 1 deletion python/sample-apps/function/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aiohttp
requests