-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
How to read response's body without copying buffer #2869
Comments
You can call |
It's only one temporary object, the Switching to |
So basically, it would look like this?
Will this solution also work with multipart requests? |
Yep! Although your |
I'm using Jackson's ObjectMapper Should I simply call
|
That will give you a read-only view of the bytes without a copy, yes. |
Awesome, thanks a lot for your support! |
Hey guys
I had to do something like
response.body().bytes()
in an Interceptor, then had to recreate a full Response with the fetched byte to return a clean Request that can be parsed again, instead of just switching the Reader Index back to it's beginning. That's a lot of temporary objects to garbage-collect.Do you have a better solution?
The text was updated successfully, but these errors were encountered: