f100ded / scala-url-builder

A minimalist URL construction library for Scala

Version Matrix

Build status Coverage Status Maven

Scala URL Builder

Scala URL Builder is a minimalist library for constructing URLs. It's native to Scala, immutable and has no external dependencies


To get started, add the following dependency into your project:

libraryDependencies += "org.f100ded.scala-url-builder" %% "scala-url-builder" % "LATEST_VERSION"

Replace LATEST_VERSION with the actual release version from the releases page.

And then you can start using the builder:

import org.f100ded.scalaurlbuilder.URLBuilder

val url = URLBuilder(base = "http://localhost/?api_key=foo_bar")
  .withPathSegments("segment1/segment2/", "segment3/")
    "lat" -> "51.509865",
    "lon" -> "-0.118092"

// url = http://localhost/segment1/segment2/segment3/#ref1?api_key=foo_bar&lat=51.509865&lon=-0.118092