-
Notifications
You must be signed in to change notification settings - Fork 9.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
Creating RequestBody from an InputStream #2424
Comments
In general we want to be able to replay a request body multiple times. But input streams can only be consumed once. |
So if I provide a large file it |
Yep. For example, if you get a 308 redirect. |
Or retries. Makes sense! Thanks. |
Course of project , i need the overload , do you find answers? |
Handling files on Android is not nice at all, so we need to use content:// URIs. |
The |
@JakeWharton yes i agree, but there is no The only way I can see to do it is to override RequestBody and source from the file descriptor. |
Yep. That's the right way.
…On Mon, Jul 30, 2018 at 5:38 PM Brill Pappin ***@***.***> wrote:
@JakeWharton <https://github.com/JakeWharton> yes i agree, but there is
no RequestBody.create(MimeType, Uri) that i can see.
The only way I can see to do it is to override RequetBody and source from
the file descriptor.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2424 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEfH84q_iL-uf7-M4WMfOzMGEROUuks5uL3zkgaJpZM4H1nhR>
.
|
I was looking at RequestBody.java and I can't find an overload for create() like this:
Is there a reason not to implement this? This is pretty useful when piping from one stream into an upload job. The overload accepting a
File
is useful for files but that's not the only scenario where buffering in memory does not work.Please shed some lights if I'm missing something. Thanks!
The text was updated successfully, but these errors were encountered: