How to do it...

For this recipe, perform the following steps:

  1. 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( ...

Get Akka Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.