为什么Json.toJson在```前加上`\`

时间:2018-06-14 08:09:51

标签: playframework-2.6

为什么\"前添加JSON?它使我的scala> import play.api.libs.json._ import play.api.libs.json._ scala> val bodyAsString = """{"result":"error","additional-info":"Incorrect body type. Body type must be JSON"}""" scala> val j2 = Json.toJson(bodyAsString) j2: play.api.libs.json.JsValue = "{\"result\":\"error\",\"additional-info\":\"Incorrect body type. Body type must be JSON\"}" 结构不正确。

(+)

0 个答案:

没有答案