How to verify content of Response Header contains a given string
I have a REST API call that returns the following in the Response Header:Content-Disposition: attachment; filename=cmdownloads.zip
I need to verify that the filename is "cmdownloads.zip" (in this case).
I captured the Header in a Header Bank but am unsure what to do next. I have tried converting it to XML and think I should be able to use an assertor with a regular expression assertion but am unsure of the exact syntax.
Suggestions?
Best Answer
-
Sure, right-click on test client, Add Output...
Select Response\Transport Header and then Search Tool from the tools pane0
Answers
-
Hi,
You could add a Search Tool (with the expected filename as a search term) to Response\Transport Header.
0 -
Sorry I am not an advanced user, can you give me specific steps for how to do that? I haven't run into a Search Tool yet.
0 -
Oh, I found it! It seems to have worked too, thanks very much.
0 -
happy it worked!
0