You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

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.)

Search results for "add_header()"

add_header()

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 in the same request (meaning the request from the client to structr).

add_header(key, value)

mail_add_header()

Adds a custom header to the mail.

mail_add_header(name, value)