5. Client API

All client-side functionality of Akka HTTP, for consuming HTTP-based services offered by other endpoints, is currently provided by the akka-http-core module.

It is recommended to first read the Implications of the streaming nature of Request/Response Entities section, as it explains the underlying full-stack streaming concepts, which may be unexpected when coming from a background with non-“streaming first” HTTP Clients.

All of the APIs deal with HttpRequest and HttpResponse objects.

Depending on your application’s specific needs you can choose from three different API levels:

Request-Level Client-Side API
for letting Akka HTTP perform all connection management. Recommended for most usages.
Host-Level Client-Side API
for letting Akka HTTP manage a connection-pool to one specific host/port endpoint. Recommended when the user can supply a Source<HttpRequest, ?>Source[HttpRequest, _] with requests to run against a single host over multiple pooled connections.
Connection-Level Client-Side API
for full control over when HTTP connections are opened/closed and how requests are scheduled across them. Only recommended for particular use cases.

You can interact with different API levels at the same time and, independently of which API level you choose, Akka HTTP will happily handle many thousand concurrent connections to a single or many different hosts.

Found an error in this documentation? The source code for this page can be found here. Please feel free to edit and contribute a pull request.