-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multipart file form data with name #3034
Comments
Excuse me guy but why all ticket related to multipart key name are closed without a solution ? |
I guess if the issue creator closed it in the same day when opened -- he found the solution. |
#3035 bugfix is not released yet IIRC |
I ywasn't able either to create a multiform payload with file content attached and a specific name. I ended up using: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/formdata.py which seems to be undocumented but worked, not sure about the drawbacks... Regards |
So there's still something wrong because I cannot figure out reading the official documentation. Or maybe, these two PR are not released yet ? |
Yes, PRs are not released. It is a new addition |
Long story short
So I want to post a file as multipart data to a file uploading site.
The request payload needs to have the name 'files[]'.
I frankly have no idea how to do this and the documentation really isn't helping.
Current code
This gives me a success from the uploader but the uploader never detects the file, which suggests the multipart file doesn't actually get given the name
files[]
as it should.Valid request example
This is an example of a valid request done through their site.
Headers: https://i.dabbitpri.me/azrr4yk7on.png
The beginning of the multipart file payload, containing the all important
name
andfilename
: https://i.dabbitpri.me/x2s2xie8dw.pngRequests
This code, using requests, works perfectly: https://hastebin.com/ecemitilat.py
The text was updated successfully, but these errors were encountered: