I have an endpoint from where I can download an xlsx file. My end goal is to validate the contents of the file. Is it possible to do it in karate by casting the response and then matching the values without writing it to a excel as mentioned in this question How to get the downloaded xlsx file from the api endpoint in karate?. Currently when I try to cast it to a string, it's printing junk values. My code is as below:
Given url url1
When method POST
Then status 200
And match header Content-disposition contains 'attachment'
And match header Content-disposition contains 'example.xlsx'
And match header Content-Type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
* string response = responseBytes
* print response