AddHTTPHeader (open)

Add a HTTP header

Syntax

LOADLIB "mod::system/lib/webserver.whlib";

MACRO AddHTTPHeader(STRING header, STRING data, BOOLEAN always_add)

Parameters

STRING header

Name of the header to add

STRING data

Data to add inside the header

BOOLEAN always_add

If true, add this header line. If false, replace the header line if it was already set

Description

Add a HTTP header to this response. The caller is responsible for not violating the HTTP spec

Examples

//Replace the content type of this document with 'plain text'
AddHTTPHeader("Content-Type","text/plain",FALSE);

//Add an X-Trace header, supplementing any existing headers
AddHTTPHeader("X-Trace", "My Harescript file",TRUE);