Let's connect
Let's connect

Scala Toolkit makes Scala powerful straight out of the box

Szymon Rodziewicz

Scala Compiler Developer

10 minutes read

Tutorials for Scala Toolkit

Show me the toolkit

bash

brew install scala-cli

java

//> using toolkit "latest"
import sttp.client4.quick.*
import sttp.client4.Response

// fetch my external ip from a remote API returning a JSON string
val response: Response[String] = quickRequest.get(uri"http://httpbin.org/ip").send()
val fileName = "my-ip.txt"                       // write our ip down to "my-ip.txt" file
val ip = ujson.read(response.body)("origin").str // read "origin" property of the json response
os.write.over(os.pwd / fileName, ip)             // overwrite output file if exists

bash

scala-cli script.sc

Liked the article?

Share it with others!

explore more on

Take the first step to a sustained competitive edge for your business

Get your free consultation

VirtusLab's work has met the mark several times over, and their latest project is no exception. The team is efficient, hard-working, and trustworthy. Customers can expect a proactive team that drives results.

Stephen Rooke
Stephen RookeDirector of Software Development @ Extreme Reach

VirtusLab's engineers are truly Strapi extensions experts. Their knowledge and expertise in the area of Strapi plugins gave us the opportunity to lift our multi-brand CMS implementation to a different level.

facile logo
Leonardo PoddaEngineering Manager @ Facile.it

VirtusLab has been an incredible partner since the early development of Scala 3, essential to a mature and stable Scala 3 ecosystem.

Martin_Odersky
Martin OderskyHead of Programming Research Group @ EPFL

The VirtusLab team's in-depth knowledge, understanding, and experience of technology have been invaluable to us in developing our product. The team is professional and delivers on time – we greatly appreciated this efficiency when working with them.

Michael_Grant
Michael GrantDirector of Development @ Cyber Sec Company