Skip to content

Instantly share code, notes, and snippets.

Created Aug 23, 2021
What would you like to do?


import aiohttp
import asyncio

async def main():
    async with aiohttp.ClientSession() as session:
        pokemon_url = ''
        async with session.get(pokemon_url) as resp:
            pokemon = await resp.json()

c#: (async/await)始祖

using aiohttp
using asyncio

async void main(){
    await using (var session = aiohttp.ClientSession()) {
        var pokemon_url = ''
        await using (var resp = await session.get(pokemon_url)) {
            pokemon = await resp.json()

Task.start(()=> main() )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment