sttp client is an open-source HTTP library for Scala with synchronous, Future, and effect-system styles across JVM, Scala.js, and Native.
Overview
sttp client lets Scala programs describe HTTP requests and handle responses through a programmer-oriented API meant to use connections safely even when errors occur. It supports direct-style synchronous calls, Future-based code, and integrations with cats-effect, ZIO, Monix, Kyo, and scalaz.
Common tasks include JSON APIs with serialization, file upload and download, HTML forms, multipart bodies, and WebSockets. URI interpolation, typed success and failure bodies, and a self-managed backend option appear in the documented examples.
Pluggable backends connect to Java HttpClient, Akka HTTP, Pekko HTTP, http4s, OkHttp, Armeria, and other stacks, so teams can match protocol needs and deployment constraints. Add-ons cover JSON libraries such as circe and play-json, logging and metrics via slf4j, scribe, OpenTelemetry, and Prometheus, plus streaming through fs2, ZIO Streams, and Akka or Pekko Streams.
The sttp family on the same site also includes tapir for documented APIs, shared HTTP models, and related tooling, though this package is the HTTP client itself. Documentation is published for multiple major versions with quickstarts for sbt, scala-cli, and Ammonite.
Key features
- Describe-then-send request API
- Multiple Scala effect styles
- Pluggable HTTP backends
- JSON serialization integrations
- WebSocket support
- Streaming response bodies
- OpenTelemetry and metrics hooks
- Stub backend for tests
Use cases
- Calling REST and JSON APIs from Scala
- Microservices HTTP clients
- Streaming downloads or uploads
- Distributed tracing of outbound HTTP