Closed syricium closed 4 months ago
I'm not familiar with aiohttp, but I got this example working pretty easily.
import aiohttp
import asyncio
async def main():
async with aiohttp.ClientSession() as session:
files = {"file": open("data.txt", "rb")}
async with session.post("http://example.com/", data=files) as response:
print(await response.text())
asyncio.run(main())
When I run it, it outputs the URL returned from transfer.sh. The documentation has more examples.
Does anyone know how to use aiohttp to put a file? I've been trying for way too long and every time I go to the page that it was supposedly uploaded to, it just gives me a 404 message. It works just fine when uploading through the website.