Python

async, aiohttp로 Multipart 데이터 전송 방법

수노 SUNHO 2019. 3. 19. 09:00


1
2
3
4
5
url = 'http://httpbin.org/post'
data = {'file': open('report.xls''rb')}
async with aiohttp.ClientSession() as session:
    async with session.post(apiEndpoint_send, data=data) as resp:
        return True
cs



참고

http://docs.aiohttp.org/en/stable/client_quickstart.html?highlight=file#post-a-multipart-encoded-file