Forum Discussion

MarcovS's avatar
MarcovS
Contributor
10 years ago
Solved

Add HTTP headerfield to Requests

Hi All,   I'm using Ready API 1.5.0 for testing REST API calls. Came across this Groovy-script that seems to be useful to add a HTTP-header field to all teststeps. I'm executing it on Project-level...
  • nmrao's avatar
    nmrao
    10 years ago
    def token = new File('C:/temp/SOAPUI/PmAuthenticationToken.txt').text
    if (token) {
       request.requestHeaders['PmAuthenticationToken'] = [token]
    } else {
       log.error("Token is empty or null")
    }