Domanda

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?

È stato utile?

Soluzione

You can use & like

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

See ParamsSpec.scala#L38.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top