Consider adding a helper method in KiwiResources to buffer entity and do fromResponse #582
Replies: 1 comment 1 reply
-
For historical reasons, we have several utility classes related to JAX-RS (now Jakarta RS) responses. Roughly, the use cases are:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
See this gist for code examples.
Whenever you create a
Response
from the response of another request, i.e.Response.fromResponse(response).build()
, according to theResponse
Javadocs you must callbufferEntity
first if the entity from the original response is unconsumed.This is one of those things that's really easy to forget about, so maybe we should create a method in
KiwiResources
that does these things for us, e.g. instead of:we could do:
The
fromResponseBufferingEntity
would basically do:Beta Was this translation helpful? Give feedback.
All reactions