DEV Community

A quick look at Java 11's HttpClient

Anthony Bruno on January 16, 2019

This article was originally posted on my blog Java 11 was released in September 2018 and is the first Long-Term-Support version after Java 8. One ...
Collapse
 
pojntfx profile image
Felicitas Pojtinger

Nice article!

I have to say though; the more I learn about Java the more I love JS:

const res = await fetch("http://anthonybruno.com.au/last-update");
const text = res.text();
console.log(text);
Enter fullscreen mode Exit fullscreen mode
Collapse
 
aussieguy profile image
Anthony Bruno

Thanks for reading :)

Unfourtantly, Java does have a verbosity problem, especially compared to a dynamic language like Javascript! fetch does have a great API. It's much nicer than the older XMLHttpRequest.

Collapse
 
cscbnguyen43 profile image
Binh Thanh Nguyen

Thanks, nice tips