-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Description
🚀 Feature Request
Add some way to quickly see the formatted JSON or XML response in the Network tab of the trace viewer.
It could be a button "Format response" in the Body (sub) tab, or a "Preview" tab similar to the Chrome Developer Tools where you can expand and collapse sections of the response, or some other solution that makes unformatted responses easier to read.
Example
JSON
Suppose we receive a response like:
{"_links":{"self":{"href":"https://api.accounting.master.dev.twinfield.com/api/users"},"current":{"href":"https://api.accounting.master.dev.twinfield.com/api/users/user?code=PAYABNAMRO"},"summaries":{"href":"https://api.accounting.master.dev.twinfield.com/api/users/summaries"},"userbasicinfo":{"href":"https://api.accounting.master.dev.twinfield.com/api/users/userbasicinfo?code={code}"},"user":{"href":"https://api.accounting.master.dev.twinfield.com/api/users/user?code={code}"},"formpostlogindeadline":{"href":"https://api.accounting.master.dev.twinfield.com/api/users/formpostlogindeadline"}}}It would be great if there was a quick way (button, a dedicated preview tab?) to see it like:
{
"_links": {
"self": {
"href": "https://api.accounting.master.dev.twinfield.com/api/users"
},
"current": {
"href": "https://api.accounting.master.dev.twinfield.com/api/users/user?code=PAYABNAMRO"
},
"summaries": {
"href": "https://api.accounting.master.dev.twinfield.com/api/users/summaries"
},
"userbasicinfo": {
"href": "https://api.accounting.master.dev.twinfield.com/api/users/userbasicinfo?code={code}"
},
"user": {
"href": "https://api.accounting.master.dev.twinfield.com/api/users/user?code={code}"
},
"formpostlogindeadline": {
"href": "https://api.accounting.master.dev.twinfield.com/api/users/formpostlogindeadline"
}
}
}XML
Original:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><ProcessXmlStringResponse xmlns="http://www.twinfield.com/"><ProcessXmlStringResult>SNIP</ProcessXmlStringResult></ProcessXmlStringResponse></soap:Body></soap:Envelope>Reformatted/preview version:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ProcessXmlStringResponse xmlns="http://www.twinfield.com/">
<ProcessXmlStringResult>SNIP</ProcessXmlStringResult>
</ProcessXmlStringResponse>
</soap:Body>
</soap:Envelope>Motivation
REST APIs or SOAP web services don't always format the responses nicely with newlines and other whitespace. It would save some time troubleshooting test failures when we could easily see the formatted (JSON or XML) responses in the Network tab of the trace viewer.
Then we don't have to copy-paste it to (for example) vscode and use some formatting tool there.