await resp.prepare(request) AttributeError: 'NoneType' object has no attribute 'prepare'

await resp.prepare(request) AttributeError: 'NoneType' object has no attribute 'prepare'

async def index(request):
    async with aiohttp.ClientSession() as client:
        data=await(email_verification(client))


        await client.post('http://127.0.0.1:8000/acc/signup',data=data)



async def email_verification(client):
    async with client.get('http://www.mocky.io/v2/5c18dfb62f00005b00af1241') as resp:

        return await(resp.json())

但每当我尝试访问 url 时,我都会收到此错误

   await resp.prepare(request)
AttributeError: 'NoneType' object has no attribute 'prepare'

我什至不明白这是什么问题,请问这个resp.prepare来自哪里

Web 处理程序应该 return 一个响应对象,而不是 None。

固定码为:

async def index(request):
    async with aiohttp.ClientSession() as client:
        data=await(email_verification(client))
        await client.post('http://127.0.0.1:8000/acc/signup',data=data)
    return web.Response(text="OK")

async def email_verification(client):
    async with client.get('http://www.mocky.io/v2/5c18dfb62f00005b00af1241') as resp:
        return await(resp.json())