Once we run the program on an EC2 instance, the HTTP server will start locally listening on port 80.
Next, execute a GET request from the command line as:
$ curl -i -X GET http://ec2-172-31-34-99.compute-1.amazonaws.com:80/
This will give Hello World! as a response, which will give the following output:
HTTP/1.1 200 OKDate: Sat, 06 Jan 2018 10:59:38 GMTContent-Length: 12Content-Type: text/plain; charset=utf-8 Hello World!