◐ Shell
clean mode source ↗

18-asyncio/charfinder/http_charfinder.py 'Request' object has no Attribute 'GET' · Issue #31 · fluentpython/example-code

This repository was archived by the owner on Dec 2, 2021. It is now read-only.

This repository was archived by the owner on Dec 2, 2021. It is now read-only.

@ghost

Description

the 18-asyncio-py3.7 folder doesn't have this file.
but this file doesn't work in aiohttp3.5.4 with Python3.7.2
the Request object has no attribute 'GET', use query instead.

def home(request):
    try:
        query = request.GET.get('query', '').strip()
    except AttributeError:
        query = request.query.get('query', '').strip()
    print('Query: {!r}'.format(query))