Reputation: 6774
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?
Upvotes: 1
Views: 139
Reputation: 126
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(", ")}")
}
Upvotes: 2