HTTP RFC states that informational 1xx response codes are considered interim responses. https://bugs.openjdk.org/browse/JDK-8292044 fixed the HttpClient to not deliver such responses as final responses to applications.
This current JBS issue is to investigate any new API on the HttpClient to allow applications to get access to such interim responses. The linked JBS proposed:
"For the mainline we should probably add a new no-op method with an empty default body to the BodyHandler interface to give the caller a chance to intercept the 1xx response."
Additionally in the PR discussion for the linked issue, one such proposed API looks like:
> "Regarding a new API, maybe a method could be added to HttpResponse.BodyHandler to supply intermediate responses?"
...
> I had a look at the HttpClient API and as you note, we could add a new method on BodyHandler to provide the application with these interim responses. Something like:
>
>/**
>* Invoked when the client receives an interim informational (1xx) response for
> * a request.
> * @param responseInfo The interim response
> */
> default void applyInterim(ResponseInfo responseInfo) {
> // do nothing by default
> }
This current JBS issue is to investigate any new API on the HttpClient to allow applications to get access to such interim responses. The linked JBS proposed:
"For the mainline we should probably add a new no-op method with an empty default body to the BodyHandler interface to give the caller a chance to intercept the 1xx response."
Additionally in the PR discussion for the linked issue, one such proposed API looks like:
> "Regarding a new API, maybe a method could be added to HttpResponse.BodyHandler to supply intermediate responses?"
...
> I had a look at the HttpClient API and as you note, we could add a new method on BodyHandler to provide the application with these interim responses. Something like:
>
>/**
>* Invoked when the client receives an interim informational (1xx) response for
> * a request.
> * @param responseInfo The interim response
> */
> default void applyInterim(ResponseInfo responseInfo) {
> // do nothing by default
> }
- relates to
-
JDK-8292044 HttpClient doesn't handle 102 or 103 properly
- Closed