Java HTTP Communication
When accessing external services or content through HTTP (HyperText Transfer Protocol), the basic choice is to use the URLConnection class (java.net package) or Apache HttpComponents (https://hc.apache.org/) before Java 11, and the HttpClient class (java.net.http package) in Java 11 and later.
Also, the HttpClient class (java.net.http package) is not included in the java.base module, which is enabled by default. To use it, declare requires in the module definition file.
module-info.java
module mynavi {
requires java.net.http;
}