capture the incoming header fields

jimboyjimboy Posts: 33

Is there a way to capture the incoming header data fields and store them in XML data bank. I would use them in the response.

Comments

  • benken_parasoftbenken_parasoft Posts: 1,011 ✭✭✭

    To extract values from the HTTP header, it sounds like you want a Header Data Bank or REST URL Data Bank.

  • jimboyjimboy Posts: 33

    I don't see options to extract the first 5 characters in the header databank

  • benken_parasoftbenken_parasoft Posts: 1,011 ✭✭✭
    edited July 29

    The Header Data Bank tool will let you extract an entire HTTP header value (request or response).

    I don't see options to extract the first 5 characters in the header databank

    Wherever you need to use the header value, you could script that field to read the header data bank column then get the desired substring:

    def getFirstFive(def context) {
        def value = context.getValue("Generated Data Source", "columnName")
        return value.substring(0, 5)
    }
    

    Alternatively, instead of using a Header Data Bank there is also a Text Data Bank. It is a tool for extracting substrings from general text based on boundaries you define for the left and right side of the substring.

Sign In or Register to comment.