Frage

Unfiltered offers an easy way to specify routes.

case GET(Path("/ask")) =>

It also offers an easy way to extract parameters.

case Params(params) =>

What if I want to do both? What is good style for this? I realize I could:

  1. use case req @ GET(Path("/ask")) and use req.parameterValues
  2. match a second time on req
  3. call Params.unapply directly

What should I do?

War es hilfreich?

Lösung

You can use & like

case GET(UFPath("/int") & Params(params)) =>

See ParamsSpec.scala#L38.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top