Campoie / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Support pretty printing #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Allow:

get("/something").andPrintBody();

Implementation:

 // pretty print format the response
                        def stringWriter = new StringWriter()
                        def node = new XmlParser().parseText(reader.text);
                        new XmlNodePrinter(new PrintWriter(stringWriter)).print(node)
                        return stringWriter.toString()

Only works for XML responses. Otherwise don't pretty print, just print.

The method should also return the (original or pretty?) body.

Original issue reported on code.google.com by johan.ha...@gmail.com on 16 Jan 2011 at 8:12

GoogleCodeExporter commented 9 years ago
Should also support asPrettyString() to only return the result as a pretty 
formatted string.

Original comment by johan.ha...@gmail.com on 30 Mar 2011 at 10:15

GoogleCodeExporter commented 9 years ago
You can do it by adding a filter

Original comment by johan.ha...@gmail.com on 22 May 2011 at 11:38

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 23 May 2011 at 6:08