SoapUI 5.4.0 XML tab don’t display JSON content like 5.0.0
If you manually need to remove/alter \r, etc. Using the RequestFilter.afterRequest event handler
You can use something like the following code to alter ‘\r’ to blank using the following code
Def content = context.httpResponse.responseContent
Log.info(content)
content = content.replaceAll (“/\r”, “”)
The above will remove ‘\r’ in the response before displaying thr resultant content in your response tabs. You could reproduce the above for all the characters you need to alter.
I’ve used the above approach before now when i had an html string in an escaped .json response and i had to verify and extract certain attribute values from thr html string.
OR, If you just want to force your .json response into .xml (so it displays correctly in your outline tab) you could add the Accept header to your request that setting the value as ‘application/xml’, this will result in your response being returned as .xml in your response.
Perhaps the above options can help?
Cheers,
Rich
Read more here: Source link
