Using Akka Http to send a GET request to any website seems to be simple with following steps:
Add akka-http dependencies to build.sbt
And add the following code to send a simple GET request:
Next, you may want to request a https site, such as https://www.youtube.com. But the code above should hang..
The reason was the root CA of this site has not been imported into trust store. Let’s resolve it by following steps:
Get root CA via command line:
The ‘keytool’ command requires Java installed in your system
Copy the last certificate including ‘—–BEGIN CERTIFICATE—–’ and ‘—–END CERTIFICATE—–’ and pass over application.conf