Forum Discussion

MartinSpamer's avatar
MartinSpamer
Frequent Contributor
12 years ago

Response Headers error

If you retrieve HTTP response headers by name they are incorrectly enclosed in square brackets even though they are strings not lists/arrays. e.g. log.info messageExchange.responseHeaders["Se...
  • nmrao's avatar
    nmrao
    9 years ago

    That is because, type is ArrayList ([] denotes a list), not String.

     

    Since it has one element in the list, 0th one should match.

     

    Below should work:

    assert messageExchange.responseHeaders["Content-Type"][0] == 'image/jpeg'