add_header()
Usage
add_header(key, value)
Description
Temporarily adds the given (key, value) tuple to the local list of request headers. All headers in this list will be added to any subsequent GET()
, HEAD()
, POST()
, PUT()
or DELETE()
call.
Example
${(add_header('X-User', 'tester1'), add_header('X-Password', 'test'), GET('http://localhost:8082/structr/rest/User'))}
results in
{ "code": 401, "message": "Wrong username or password, or user is blocked. Check caps lock. Note: Username is case sensitive!" }
(Please note that this example deliberately uses the wrong credentials to provoke the above error message.)