For this recipe, perform the following steps:
- First, use the connection-level API. Create a file named ConnectionLevelClientAPIApplication.scala in the com.packt.chapter9 package. The content should be as follows:
package com.packt.chapter9 import akka.actor.ActorSystem import akka.http.scaladsl.Http import akka.http.scaladsl.model.HttpRequest import akka.stream.ActorMaterializer import akka.stream.scaladsl.{Sink, Source} import scala.util.{Failure, Success} import scala.concurrent.duration._ object ConnectionLevelClientAPIApplication extends App { implicit val system = ActorSystem() implicit val materializer = ActorMaterializer() implicit val executionContext = system.dispatcher val connectionFlow = Http().outgoingConnectionHttps( ...