Skip to content Skip to sidebar Skip to footer

Ajax-like Non-blocking Asynchronous Python Requests

I looked through numerous questions and answers but none work for me. Is there a way to achieve AJAX-like functionality in Python? Let's say you have this setup: url = 'http://http

Solution 1:

If you are able to use Python 3, take a look at aiohttp. It allows you to make and handle asynchronous requests like:

async with aiohttp.ClientSession() as session:
    async with session.get('https://api.github.com/events') as resp:
        print(resp.status)
        print(await resp.text()

Post a Comment for "Ajax-like Non-blocking Asynchronous Python Requests"