RFR: 8327796: Add method to java.net.http.HttpRequest to return a GET request in one call [v2]
Daniel Fuchs
dfuchs at openjdk.org
Tue Mar 12 16:24:14 UTC 2024
On Tue, 12 Mar 2024 16:18:15 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Michael McMahon has updated the pull request incrementally with one additional commit since the last revision:
>>
>> update Daniel review
>
> src/java.net.http/share/classes/java/net/http/HttpResponse.java line 153:
>
>> 151: * @return an Optional containing the response body if the predicate returns true
>> 152: */
>> 153: public Optional<T> bodyWhen(Predicate<ResponseInfo> predicate) throws IOException;
>
> This is a neat idea which will allow to append additional steps like `.orElseThrows(...)` etc...
I wonder if it should be a `Predicate<HttpResponse>` instead?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18227#discussion_r1521769849
More information about the net-dev
mailing list