Skip to content

Instantly share code, notes, and snippets.

@AleksandrIakhnev
Created September 14, 2016 14:50
Show Gist options
  • Save AleksandrIakhnev/6541a3b3d47a84fc55ffd4790b8bb1e1 to your computer and use it in GitHub Desktop.
Save AleksandrIakhnev/6541a3b3d47a84fc55ffd4790b8bb1e1 to your computer and use it in GitHub Desktop.
import aiohttp
import asyncio
async def test():
with aiohttp.ClientSession() as session:
with aiohttp.MultipartWriter() as mpwriter:
data = "\n".join(["My multipart command "])
mpwriter.append(data, headers={'Content-Transfer-Encoding':'binary'})
async with session.post("https://google.com", data=mpwriter) as response:
print(response.status)
asyncio.get_event_loop().run_until_complete(test())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment