CResponse::addHeader

The CResponse::addHeader function adds an HTTP header to the response.

int addHeader(
chchar * headerName // points to a string containing the header name
chchar * headerValue // points to a string containing the header value
);



Return Type

int
Upon successful completion, zero is returned. Otherwise, a value of non-zero is returned.


Parameters

headerName
A string containing the header name.

headerValue
A string containing the header value.


Remarks

This function adds an HTTP header to the HTTP response. It always adds a new HTTP header to the response. It will not replace an existing header of the same name. Once a header has been added, it cannot be removed.

This function shall be called before member function CResponse::begin is called.


See Also

CResponse, CResponse::begin

Example