How do I parse json like this:
[{"name":"joe","address","Main Street"}]
with the from() method in restassured:
assertEquals(true, from(myjson).getString("name"));
I get this error:
[Fatal Error] :1:1: Content is not allowed in prolog.
How do I parse json like this:
[{"name":"joe","address","Main Street"}]
with the from() method in restassured:
assertEquals(true, from(myjson).getString("name"));
I get this error:
[Fatal Error] :1:1: Content is not allowed in prolog.
我的猜测是你正在使用XmlPath.from()
而不是JsonPath.from()
,所以它试图将你的 JSON 解析为 XML。