Para::Frame::Request::Ctype - The request response content type
You get this object by using Para::Frame::Request::Response/ctype.
Para::Frame::Client will mostly default to text/html
and
UTF-8
.
$ctype->set( $string )
Sets the content type to the given string. The string should be formatted as in a HTTP header. It can include several extra parameters.
The only supported extra parameter is charset
, that is set using
/set_charset.
The actual header is not written until after the response page has been generated.
Previous parameters will be removed.
Example:
$ctype->set("text/plain; charset=UTF-8")
$ctype->set_type( $type )
$ctype->set_charset( $charset )
Sets the charset of the content type.
There is no validation of the sting given.
$ctype->charset()
The internal working will always be in UTF8. This controls how text are sent to the client.
Returns: the current charset
$ctype->type()
Returns: the current Content-Type
$ctype->as_string
Returns a string representation of this object, suitible to be used in the HTTP header.
$ctype->is( $ctype )
Jonas Liljegren <jonas@paranormal.se>