sttp: the Scala HTTP client you always wanted!


sttp client is an open-source library which provides a clean, programmer-friendly API to describe HTTP requests and execute them using one of the wrapped backends, such as akka-http, async-http-client, http4s or OkHttp.

Here’s a very quick example of sttp client in action:

import sttp.client._

val sort: Option[String] = None
val query = "http language:scala"

// the `query` parameter is automatically url-encoded
// `sort` is removed, as the value is not defined
val request = basicRequest.get(

implicit val backend = HttpURLConnectionBackend()
val response = request.send()

// response.header(...): Option[String]

// response.unsafeBody: by default read into a String

For more examples, see the usage examples section. Or explore the features in detail:

Other sttp projects

sttp is a family of Scala HTTP-related projects, and currently includes:

  • sttp client: this project
  • sttp tapir: Typed API descRiptions
  • sttp model: simple HTTP model classes (used by client & tapir)