filiphric / cypress-plugin-api

Cypress plugin to show your API information in the Cypress UI runner
ISC License
264 stars 35 forks source link

XML request and Response show in single line instead of showing proper XML. #100

Closed matifniaz closed 1 year ago

matifniaz commented 1 year ago

XML requests and Responses are displayed in a single line instead of displaying in proper XML. image Kindly add support for displaying XML.

filiphric commented 1 year ago

Hey @matifniaz the plugin actually has support for xml, but it relies on server returning text/xml in response header from server. What kind of header does your response header have?

matifniaz commented 1 year ago

image we received Content-Type: application/octet-stream

@filiphric In postman its look like this. image

filiphric commented 1 year ago

releasing fix for this in version 2.10.0

matifniaz commented 1 year ago

image Still, it's now showing in showing proper XML.

filiphric commented 1 year ago

image

Still, it's now showing in showing proper XML.

The fix now checks whether the response is a valid xml. If it is it will treat it like one, otherwise it's formatted as plain text.

From the screenshot, it seems that the string is not valid xml because it does not have a closing tag. Not sure there's anything I can do if the xml is not valid.