On Tue, 12 Mar 2024 21:42:57 GMT, Michael McMahon <[email protected]> wrote:

>> I wonder if it should be a `Predicate<HttpResponse>` instead?
>
> No, we added `HttpResponse.ResponseInfo` for this kind of purpose. It's an 
> immutable subset of HttpResponse state (notably excluding the body itself 
> which is potentially mutable). Also it would be strange to make the body 
> available to a predicate that is deciding whether to provide access to the 
> body.

OK - I see the point about the body. I was asking because `HttpResponse` has 
some additional info like request, previous request, and SSL session. On the 
other hand all what you need to make a decision here is probably status code 
and response headers which `ResponseInfo` provides.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18227#discussion_r1523052457

Reply via email to