Consuming Akka HTTP services using a client-side API
Akka HTTP provides capabilities to consume remote HTTP services. Other frameworks, such as Apache HttpComponents, also provide the same functionality; however, Akka HTTP is asynchronous and streaming-first by default. The Akka HTTP client API uses the same abstractions as the HTTP server API, but it adds the concept of connection pooling. This concept allows developers to reuse connections and improve performance.
It is important to mention that, since Akka HTTP is streaming-first and built on top of Akka streams, there is built-in back pressure. This means that it is required to consume the HTTP entities to signal the stream that you are good to receive new ones. This is required even if you want to discard them. Not doing so might impact your application negatively without apparent reason. The HTTP client API is divided into three levels of abstraction:
- Connection level: This represents the lowest level. It provides full control of HTTP...