scala spray get long list of parameters

150 views Asked by At

I have an application written on scala/spray, and a GET function that need to receive a long list of parameters (30+).

what is the best way to receive them in route as an hashMap or object?

1

There are 1 answers

0
jack On BEST ANSWER

Use parameterMap

example:

parameterMap { params =>
    def paramString(param: (String, String)): String = s"""${param._1} = '${param._2}'"""
    complete(s"The parameters are ${params.map(paramString).mkString(", ")}")
  }