JsValue - JSON. JsObject JsValue ( JsNull, JsUndefined, JsBoolean, JsNumber, JsString JsArray). JSON, : http://json.org/
, JSON body JSON ( , ), :
def genericJSONResponse = Action(parse.json) { request =>
request.body match {
case JsObject(fields) => Ok("received object:" + fields.toMap + '\n')
case _ => Ok("received something else: " + request.body + '\n')
}
}
fields.toMap , : Map[(String, JsValue)], map collect . (, fields, a Seq[(String, JsValue)] map collect).