Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active February 3, 2026 20:23
Show Gist options
  • Select an option

  • Save dacr/d7fc9d8f8607f0adebda553dfe185bff to your computer and use it in GitHub Desktop.

Select an option

Save dacr/d7fc9d8f8607f0adebda553dfe185bff to your computer and use it in GitHub Desktop.
Simplest sttp http client library example. / published by https://github.com/dacr/code-examples-manager #f1d1b2f8-1ddf-4f17-9afa-4dc80c8b7c92/6830e7d0ec914e4d58945a07450c115ecef98872
// summary : Simplest sttp http client library example.
// keywords : scala, sttp, http-client, @testable
// publish : gist
// authors : David Crosson
// license : Apache License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
// id : f1d1b2f8-1ddf-4f17-9afa-4dc80c8b7c92
// created-on : 2019-05-19T16:59:54Z
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
// ---------------------
//> using scala "3.4.2"
//> using dep "com.softwaremill.sttp.client3::core:3.7.0"
// ---------------------
import sttp.client3.*
println(
quickRequest
.get(uri"http://mapland.fr/ip")
.response(asStringAlways)
.send(quick.backend)
.body
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment