0

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.

1
  • 1
    Is your json just a String? It seems like your parser is expecting XML. Commented May 23, 2013 at 0:48

1 Answer 1

1

My guess would be you're using XmlPath.from() instead of JsonPath.from(), so it's trying to parse your JSON as XML.

Sign up to request clarification or add additional context in comments.

1 Comment

That was it! Eclipse had pulled in "...xml.XmlPath.from" instead of "...json.JsonPath.from;" in the imports.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.