djangid / rest-assured

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

Add pretty-print support for request and response body #140

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When logging request and response body add support for pretty-printing it

Original issue reported on code.google.com by johan.ha...@gmail.com on 5 Jan 2012 at 10:23

GoogleCodeExporter commented 8 years ago
For JSON:
JsonOutput.prettyPrint('''{"person":{"name":"Guillaume","age":33,"pets":["Hector
","Felix"]}}''')​​​​​​​​​​​​

Original comment by johan.ha...@gmail.com on 5 Jan 2012 at 3:32

GoogleCodeExporter commented 8 years ago
For XML:

def xml = "<rss><channel><title></title><description>" +
   "</description><link></link><item></item></channel></rss>"

def stringWriter = new StringWriter()
def node = new XmlParser().parseText(xml);
new XmlNodePrinter(new PrintWriter(stringWriter)).print(node)

Original comment by johan.ha...@gmail.com on 5 Jan 2012 at 3:35

GoogleCodeExporter commented 8 years ago

Original comment by johan.ha...@gmail.com on 9 Jan 2012 at 6:13

GoogleCodeExporter commented 8 years ago

Original comment by johan.ha...@gmail.com on 15 Jan 2012 at 4:55