With Bee Client, making an HTTP call simply involves
- constructing a request, with data, headers and cookies as needed
- executing the request (use either the
HttpClient
orHttpBrowser
class to do this) - dealing with the response, including the status, data, headers and cookies it may include.
The API is designed around immutable data-structures, mostly using Scala case classes. This is to make it both easy to use and thread-safe.
Good performance is also an important consideration, with care having been taking to avoid wasteful processing. Memory footprint is carefully controlled in various ways. Notably, when required, streaming of input data and output data is possible.
Complete but simple access to the innards of HTTP is a design goal. It should be possible to achieve (almost) any kind of request without too much ceremony.
Configuration, headers, cookies and requests are all immutable. Responses are essentially immutable too, although internally they may convert response body data lazily when needed (so technically they’re not strictly immutable).
Requests are intrinsically blocking; it is also easy to compose non-blocking requests using, for example, standard Scala Future APIs.