Question

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?

Was it helpful?

Solution

You can use & like

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

See ParamsSpec.scala#L38.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top