CResponse::setContentType

The CResponse::setContentType function sets the value of the ContentType property.

int setContentType(
chchar * contentType // containing the new ContentType value
);



Return Type

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


Parameters

contentType
A string containing the new ContentType value. Valid values of ContentType include text/plain, text/html, image/gif, etc.


Remarks

This function sets the value of the ContentType property of the object. The content type of the output of Ch-CGI and Ch-ASP is text/html by default.

The CResponse::getContentType function can retrieve the ContentType property of the object

In Ch-CGI, this function and other CResponse::set* member functions, should be called before CResponse::begin is called.


See Also

CResponse, CResponse::getContentType

Example