Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # aiohttp <code> @router.get("/") async def products_get(request: Request): url = "https://YOUR_DOMAIN/products" async with aiohttp.ClientSession() as client: resp = await client.get(url) text = await resp.text() return Response(text, status_code=resp.status, headers=resp.headers) @router.get("/{product_id}") async def product_get(product_id: int, request: Request): url = f"https://YOUR_DOMAIN/products/{product_id}" resp = await aiohttp.ClientSession().get(url) text = await resp.text() return Response(text, status_code=resp.status, headers=resp.headers) </code> open/aiohttp.txt Last modified: 2024/10/05 06:15by 127.0.0.1