I'm currently leaning HTTP/2 Client in Java9~10 through this.
Java 9 does have HttpRequest.BodyProcessor
interface while Java 10 does not have HttpRequest.BodyProcessor
, but instead it does have HttpRequest.BodyPublisher
. Both interfaces are similar.
Why are Java change Interface's name? I think backward compatibility ignored.
The HttpClient
has been a part of an incubator module with Java 9 and 10. So what one saw there was more of a prototyped work which though ideally shouldn't change much, yet doesn't guarantee the same.
From the incubator JEP#Incubator Modules:
An incubating feature is an API of non-trivial size that is under development for eventual inclusion in the Java SE Platform, or the JDK, but is not yet sufficiently proven.
If you wish to use the standard module you can make use of it in Java 11, where it is named as java.net.http
. [notice that its marked as since Java 11 and not 9 or 10]
The jdk.incubator.httpclient module not found in Java11 could help you migrate the usage of HttpClient
in Java 11 if you were already using that in Java9/10.
Slightly Off-topic: If you could compare the source code in the two JDK, you would find that there have been updates to the methods in the BodyPublisher
as compared to its previous state, both in Java 10 as well as Java 11.