Is your feature request related to a problem? Please describe.
I want to be able to convert HttpResponse<A> to HttpResponse<B> without having to take out the body with getBody. This is because I want the caller to be able to handle the HttpResponse object, I don't just want to return A or B. Specifically it would be nice to able to convert HttpResponse<A[]> to HttpResponse<Stream<A>>.
Describe the solution you'd like
A function of type:
HttpResponse<V> map(Function<T, V> func);
That returns a new HttpResponse with all the same data except that it transforms the body with the given function (functor). It would be a new object reference but has all of the same data (headers, parsing errors, etc).
Is your feature request related to a problem? Please describe. I want to be able to convert
HttpResponse<A>
toHttpResponse<B>
without having to take out the body withgetBody
. This is because I want the caller to be able to handle theHttpResponse
object, I don't just want to returnA
orB
. Specifically it would be nice to able to convertHttpResponse<A[]>
toHttpResponse<Stream<A>>
.Describe the solution you'd like A function of type:
That returns a new HttpResponse with all the same data except that it transforms the body with the given function (functor). It would be a new object reference but has all of the same data (headers, parsing errors, etc).