Extends
lithium\net\http\Request
Sets/Gets the content type. If `'type'` is null, the method will attempt to determine the
type from the params, then from the environment setting
Parameters
- string $type a full content type i.e. `'application/json'` or simple name `'json'`
Returns
string A simple content type name, i.e. `'html'`, `'xml'`, `'json'`, etc., depending on the content type of the request.Source
public function type($type = null) {
if ($type === null) {
$type = $this->type ?: $this->env('CONTENT_TYPE');
}
return parent::type($type);
}