-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
HTTP multipart request encoded as chunked transfer-encoding #1376
Comments
When using chunked encoding:
When not using chunked encoding:
It seems like these servers do not understand a chunked request correctly. In fact, chunked encoding in HTTP/1.1 is defined as 'server encoding', which is probably why some server implementations do not understand it correctly - http://stackoverflow.com/questions/8210698/iis7-refuses-chunked-encoded-file-upload .. although many servers these days seem to understand chunked requests. So, the fix should be make the multipart encoder pre-calculate the length of the content instead of using chunked encoding. |
I guess this requires large changes in our multipart code. Rescheduling for 4.1. Meanwhile, for the servers that do not handle chunked multipart requests, please convert a chunked request into a non-chunked one. |
Even better, please use the multipart code in Apache HTTP Components just like async-http-client does: https://github.com/AsyncHttpClient/async-http-client |
@trustin Thanks for looking into it. I'll apply one of your suggestions later. |
@zcourts did the "workaround" work for you ? |
We should not close this even if there is a workaround by the way. |
@normanmaurer Yes, non-chunked request works. I haven't tried doing what async-htttp-client does yet |
Alright… thanks to let me know. Am 04.07.2013 um 08:47 schrieb Courtney Robinson notifications@github.com:
|
@normanmaurer no probs. |
hi, @normanmaurer , i just use Netty recently, and i may met a same problem with you before. when use http FileUpload client, it's request header add transfer-encoding: chunked. but my phpstudy server can not resolve it maybe, i use wireshark capture and find file data received, but file not saved in disk. and i try to setting non-chunked model, but i confused how to setting? follwing is my code: i do some changes in request header, but bodyRequestEncoder.isChunked() still true. can you give me some suggestion? thanks. |
After hours of debugging, I finally found the root cause of my problems - this issue. Trying to add an attachment to a Trello card. When doing it from the web UI, the multipart request is not chunked and |
I modified HttpUploadClient.java from the example and ran it against http://httpbing.org/post and http://posttestserver.com/post.php . In both cases no form parameters were sent and the file was not uploaded. POST requests to the same servers work when it's only url-encoded i.e. no files. The same example does work against the HTTP upload example server.
This is using the latest from master...
For convenience the modified file has
The text was updated successfully, but these errors were encountered: