The Scala Toolkit

Sending HTTP requests with sttp

Language

sttp is a popular and feature-rich library for making HTTP requests to web servers.

It provides both a synchronous API and an asynchronous Future-based API. It also supports WebSockets.

Extensions are available that add capabilities such as streaming, logging, telemetry, and serialization.

sttp offers the same APIs on all platforms (JVM, Scala.js, and Scala Native).

sttp is a good choice for small synchronous scripts as well as large-scale, highly concurrent, asynchronous applications.

You can require the entire toolkit in a single line:

//> using toolkit latest

Alternatively, you can require just a specific version of sttp:

//> using dep com.softwaremill.sttp.client4::core:4.0.0-M6

In your build.sbt file, you can add a dependency on the Toolkit:

lazy val example = project.in(file("."))
  .settings(
    scalaVersion := "3.3.3",
    libraryDependencies += "org.scala-lang" %% "toolkit" % "0.1.7"
  )

Alternatively, you can require just a specific version of sttp:

libraryDependencies += "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M6"

In your build.sc file, you can add a dependency on the Toolkit:

object example extends ScalaModule {
  def scalaVersion = "3.3.3"
  def ivyDeps =
    Agg(
      ivy"org.scala-lang::toolkit:0.1.7"
    )
}

Alternatively, you can require just a specific version of sttp:

ivy"com.softwaremill.sttp.client4::core:4.0.0-M6"

Contributors to this page: