我只想检查 REST 请求中发送的参数。我见过类似S.param("paramName")
, 或的方法S.params("??")
,但我只想查看所有参数。我该怎么做?
在这里检查过:http: //simply.liftweb.net/index-Chapter-11.html,还有许多 SO 线程,但只找到如何获取某些参数。
编辑向代码添加不起作用的建议
Edit2发现问题,我把请求的返回值注释掉了:)
我当前的代码:
object WebserviceHandler extends RestHelper {
serve {
case "somePath" :: Nil JsonPost _ =>
//1st try
for(s <- S.request; r <- s.params) { //compiler error: "could not find implicit value for parameter c: (Unit) => net.liftweb.http.LiftResponse"
val (paramName:String, paramVals:List[String]) = r
}
//2nd try
S.request.foreach(x =>
x.paramNames.foreach(p =>
println(p) //compiler error: "scala is not an enclosing class"
)
);
//Extraction.decompose(someList) //<--- Problem- this line was commented
//...
}
}
提前致谢。