-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Big file as request body #495
Comments
I need it, too. |
I need the ability to upload files of many GB, thus a stream-like implementation is mandatory. |
I have just run into this and will have to jump libraries—a bit of a shame. Trying to copy an I looked, and I think both https://github.com/monaco-io/request and https://github.com/imroc/req handle this correctly. |
Done, refer to PR. |
Great, thanks! |
@thxbb12 Thanks. I have added this feature as part of the upcoming Resty v3. |
Thanks @jeevatkm. I was hoping it would be available in the next 2.15.x release. |
@thxbb12 Resty v3 will take time (possibly around the new year). It will have more features and options than v2 and be more efficient. Is this okay for your timeline? |
Yes, that's fine. I cannot really complain as I'm not the one working on it myself (although I wish I had enough time to contribute). |
Thank you @thxbb12. You can watch v3 progress here. I will be heading to work in a while before leaving. I saw your comment. Good chat. |
I'm uploading a file as request body with size of 4GB and found that resty copies full file content into memory (to handle
http.Request.GetBody
callback?). However, it is not necessary becausenet/http.Client
only views the body as anio.ReadCloser
.resty/middleware.go
Lines 521 to 543 in 7dda615
After reading closed issue and full code of resty, no api can help me avoid the http client reading all file content. It is expected that resty can expose a stream-like api or handle a cloneable reader implicitly to get request retrying functionality.
or
The second approach is better in the case of
net/http.Client
never callingGetBody
callbackThe text was updated successfully, but these errors were encountered: