Java 9: Why Is There A New HTTP Client?

Regarding JEP 110: HTTP/2 Client one might reasonably ask the question: “Why is Java 9 introducing a new HTTP client when there are so many high-quality and time-tested libraries out there?”

There are several answers:

  1. The first is provided by the the JEP itself: “A number of existing HTTP client APIs and implementations exist, e.g., Jetty and the Apache HttpClient. Both of these are both rather heavy-weight in terms of the numbers of packages and classes, and they don’t take advantage of newer language features such as lambda expressions.”
  2. Another reason is that with a built-in http client, we can easily use it in the new REPL (thanks Java 9!) without needing to bring in another library.
  3. Finally, this way the Java platform is free to use a high quality http client for other Java platform features without needing a dependency on an external third-party library.

This question and the thoughtful answer #3 have been brought to you by The Audience from my talk on Java 9 with the Philly Java Users Group. Thanks Philly JUG!

Advertisements

Leave a comment

Filed under Java 9

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s