Skip to content
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

Option to disable transfer-encoding: chunked? #2190

Closed
tevjef opened this issue Jan 3, 2016 · 1 comment
Closed

Option to disable transfer-encoding: chunked? #2190

tevjef opened this issue Jan 3, 2016 · 1 comment

Comments

@tevjef
Copy link

tevjef commented Jan 3, 2016

From what I've read about multipart uploads. Either a Content-Length or a Transfer-Encoding header must be specified. OkHttp seems to be doing some compression behind the scenes and strips the Content-Length header of a multipart POST request in favor of Transfer-Encoding: chunked.

Is there a way to disable that transparent compression so I can reliably add a content-length header?

Why? I'm uploading to to Amazon S3 and they don't seem to support Transfer-Encoding: chunked.

@tevjef
Copy link
Author

tevjef commented Jan 6, 2016

OkHttp needs to know the size of the file ahead of time or else it's will send it in chunks. Overriding the contentlength() method in the RequestBody provides that information to OkHttp and it add that information to the header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant