public function withType($contentType)
    {
        $mappedType = $this->resolveType($contentType);
        $new = clone $this;
        $new->_contentType = $mappedType;
        $new->_setContentType();

        return $new;
    }
public function withType($contentType)
    {
        $mappedType = $this->resolveType($contentType);
        $new = clone $this;
        $new->_contentType = $mappedType;
        $new->_setContentType();

        return $new;
    }
public function withType ( $ contentType ) { $ mappedType = $ this -> resolveType ( $ contentType ) ; $ new = clone $ this ; $ new -> _contentType = $ mappedType ; $ new -> _setContentType ( ) ; return $ new ; }
Get an updated response with the content type set.

If you attempt to set the type on a 304 or 204 status code response, the
content type will not take effect as these status codes do not have content-types.

@param string $contentType Either a file extension which will be mapped to a mime-type or a concrete mime-type.
@return static
Get an updated response with the content type set .