Last active
February 3, 2026 20:23
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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