A simple demo for the usage of Java 11 HttpClient.
Start the simple Python HTTP server.
$ ./dummy-http-server.py
It listen on http://localhost:8080 and respond to a GET with a permanent redirect HTTP 308 to http://example.com.
To compile and run the Java client you need Java >= 11
compile:
$ javac HttpClient11.java
execute:
$ java HttpClient11
response:
<!doctype html>
<html>
<head>
<title>Example Domain</title>
...
Using curl instead of the Java client.
$ curl -L http://localhost:8080
response is the same as above with the Java client