How it works...
In this recipe, we revisited how to use different Akka HTTP Client API levels to perform a GET request. To begin with, we used the Connection-Level Client API. This API relies heavily on Akka Streams. Akka HTTP treats connections as Akka Streams flows. This means a connection will receive a request as input and send a response as output. We used Sink.head to receive Future[HttpResponse], which eventually holds the value of the response. To retrieve the actual content of the response, we need to get entity and decode it to UTF8. After all that, we simply extract the desired value, thanks to a regular expression, and print out the number of open issues.
Second, we used the Host-Level Client API. This is similar to the previous ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access