Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How can I test that a response header equals a certain value?

BrianQuantum
BrianQuantum Posts: 23
edited February 2018 in SOAtest

I have a rest command that returns a Content-Type of application/octet-stream and a Content-Disposition with a filename. What is the best way to validate that the values returned in the headers are what I am expecting?

Comments

  • OmarR
    OmarR Posts: 231 admin

    There are a few ways to set this up, but the quickest way is to attach a Diff tool to the Response-Transport-Header Output:

    Copy/paste the header structure that is expected in the Diff tool.
    Run the client. You will likely get an error in the Quality task indicating the header Date/time has changed. Therefore, we can ignore this header by right-clicking the task and selecting "Ignore Difference".

  • BrianQuantum
    BrianQuantum Posts: 23

    Thank you. That's perfect

  • ashwini
    ashwini Posts: 11

    How I can validate that a field in request header is having a value which is following a pattern. I have a filed in request herader name - applicant Id : TEST001. Now I have to validate that applicant id should always be starts with TEST.

  • benken_parasoft
    benken_parasoft Posts: 1,087 ✭✭✭
    edited April 2020

    I answered this a different way in this other post, using a Header Data Bank and Diff tool. See Pattern check in request header field