import aiohttp
import asyncio

async def stream_response():
    async with aiohttp.ClientSession() as session:
        async with session.post('your url',headers={"xxx": "xxx"},data='{"xxx": "xxx"}') as response:
            async for line in response.content.iter_any():
                print(line.decode(),end='')


async def main():
    await stream_response()

asyncio.run(main())
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐