slakah / uritemplate4s   0.5.10

MIT License Website GitHub

Scala implementation of URI Template (RFC 6570)

Scala versions: 2.13 2.12
Scala.js versions: 1.x 0.6

uritemplate4s

CircleCI Join the chat at https://gitter.im/slakah/uritemplate4s Latest version

Scala implementation of URI Template (RFC 6570).

Getting Started

uritemplate4s is currently available for Scala 2.13, 2.12 and Scala.js.

Add the following to your build.sbt:

libraryDependencies += "com.gubbns" %% "uritemplate4s" % "0.5.7"

Usage

import uritemplate4s._

val template = uritemplate"https://{host}/search{?q}{&params*}"
template.expand(
    "host" -> "search-engine.com",
    "q" -> "Esio Trot",
    "params" -> Map("lang" -> "en", "type" -> "book")
  ).value
// res0: String = https://search-engine.com/search?q=Esio%20Trot&lang=en&type=book

Further documentation is available here.