Sets the {@code "content-type"} header. This method is a shortcut of:
<pre>{@code
builder.autoDetectedContentType(false);
builder.setHeader(HttpHeaderNames.CONTENT_TYPE, contentType);
}</pre>
436878
public final B contentType(MediaType contentType) {
        requireNonNull(contentType, "contentType");
        autoDetectedContentType(false);
        getOrCreateHeaders().contentType(contentType);
        return self();
    }
920481
public function setContenttype($contenttype)
    {
        if (is_string($contenttype)) {
            $contenttype = $this->app['storage']->getContenttype($contenttype);
        }

        $this->contenttype = $contenttype;
    }
125399
public function setContentType(string $contentType): void
    {
        $this->contentType = $contentType;
        // TODO: This can be removed after the full changes are done for next major.
        $this->headers->set('Content-Type', $contentType, true);
    }
1267653
public MediaType getContentType() {
        if (isNull(this.contentType)) {
            contentType = getHeader(HeaderName.CONTENT_TYPE)
                .map(MediaType::of)
                .orElse(WILDCARD);
        }

        return contentType;
    }
534450
private function setHeaderContentType()
    {
        $fileName = basename( $this->fileName );
        if ( $this->contentDisposition !== null && $this->contentDisposition->fileName !== null )
        {
            $fileName = $this->contentDisposition->fileName;
        }

        $this->setHeader( 'Content-Type',
                          $this->contentType . '/' . $this->mimeType . '; ' . 'name="' . $fileName . '"' );
    }
163428
public void setType(int type) {
        this.type = type;
        if(headerAll != null) {
            headerAll.setType(this.type);
        }
        if(headerFirst != null) {
            headerFirst.setType(this.type);
        }
        if(headerLeft != null) {
            headerLeft.setType(this.type);
        }
        if(headerRight != null) {
            headerRight.setType(this.type);
        }
    }
1133950
public function setContentType(string $content_type)
    {
        if (empty($content_type)) {
            Throw new HeaderException('Empty content type is not allowed.');
        }

        $this->content_type = $content_type;
    }
687601
public static Builder setContentTypeHeaders(boolean isBinaryTransportEnabled, Builder requestBuilder)
    {
        if (isBinaryTransportEnabled) {
            return requestBuilder
                    .setHeader(CONTENT_TYPE, APPLICATION_JACKSON_SMILE)
                    .setHeader(ACCEPT, APPLICATION_JACKSON_SMILE);
        }
        return requestBuilder
                .setHeader(CONTENT_TYPE, JSON_UTF_8.toString())
                .setHeader(ACCEPT, JSON_UTF_8.toString());
    }
661714
public KieServerHttpRequest contentType(final String contentType, final String charset ) {
        if( charset != null && charset.length() > 0 ) {
            final String separator = "; " + PARAM_CHARSET + '=';
            return header(CONTENT_TYPE, contentType + separator + charset);
        } else
            return header(CONTENT_TYPE, contentType);
    }
1217012
@Override
    public String getContentType() {
        String type = this.response.getHeader("Content-Type");
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getContentType: " + type);
        }
        return type;
    }
1179466
def set_content_type (self):
        """"""
        if self.url:
            self.content_type = mimeutil.guess_mimetype(self.url, read=self.get_content)
        else:
            self.content_type = u""
930069
public Message contentType(String contentType) {
        basicProperties = basicProperties.builder()
                .contentType(contentType)
                .build();
        return this;
    }
423461
private void setContentTypeHeader(HttpResponse response, URLConnection resUrlConnection) {
    MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap();
    String resName = resUrlConnection.getURL().getFile();
    response.headers().set(HttpHeaderNames.CONTENT_TYPE, mimeTypesMap.getContentType(resName));
  }
878720
public ContentType getContentType() {
        String contentType = m_headers.get(HttpDefs.CONTENT_TYPE);
        if (contentType == null) {
            return null;
        }
        return new ContentType(contentType);
    }
407461
public void setType(String type) throws ApplicationException {
	if (StringUtil.isEmpty(type, true)) return;
	type = type.toLowerCase().trim();

	if (type.equals("url")) param.setType(HttpParamBean.TYPE_URL);
	else if (type.equals("formfield") || type.equals("form")) param.setType(HttpParamBean.TYPE_FORM);
	else if (type.equals("cgi")) param.setType(HttpParamBean.TYPE_CGI);
	else if (type.startsWith("head") || type.startsWith("header")) param.setType(HttpParamBean.TYPE_HEADER);
	else if (type.equals("cookie")) param.setType(HttpParamBean.TYPE_COOKIE);
	else if (type.equals("file")) param.setType(HttpParamBean.TYPE_FILE);
	else if (type.equals("xml")) param.setType(HttpParamBean.TYPE_XML);
	else if (type.equals("body")) param.setType(HttpParamBean.TYPE_BODY);
	else throw new ApplicationException("invalid type [" + type + "], valid types are [body,cgi,cookie,file,form,head,url,xml]");
    }
66082
public int setContentType(final int type) {
		this.type = type;
		// If the new type has Application, but there is no application fw, remove this type bit
		if ((type & DfuBaseService.TYPE_APPLICATION) > 0 && applicationBytes == null)
			this.type &= ~DfuBaseService.TYPE_APPLICATION;
		// If the new type has SD+BL
		if ((type & (DfuBaseService.TYPE_SOFT_DEVICE | DfuBaseService.TYPE_BOOTLOADER)) == (DfuBaseService.TYPE_SOFT_DEVICE | DfuBaseService.TYPE_BOOTLOADER)) {
			// but there is no SD, remove the softdevice type bit
			if (softDeviceBytes == null && softDeviceAndBootloaderBytes == null)
				this.type &= ~DfuBaseService.TYPE_SOFT_DEVICE;
			// or there is no BL, remove the bootloader type bit
			if (bootloaderBytes == null && softDeviceAndBootloaderBytes == null)
				this.type &= ~DfuBaseService.TYPE_SOFT_DEVICE;
		} else {
			// If at least one of SD or B: bit is cleared, but the SD+BL file is set, remove both bits.
			if (softDeviceAndBootloaderBytes != null)
				this.type &= ~(DfuBaseService.TYPE_SOFT_DEVICE | DfuBaseService.TYPE_BOOTLOADER);
		}

		if ((type & (DfuBaseService.TYPE_SOFT_DEVICE | DfuBaseService.TYPE_BOOTLOADER)) > 0 && softDeviceAndBootloaderBytes != null)
			currentSource = softDeviceAndBootloaderBytes;
		else if ((type & DfuBaseService.TYPE_SOFT_DEVICE) > 0)
			currentSource = softDeviceBytes;
		else if ((type & DfuBaseService.TYPE_BOOTLOADER) > 0)
			currentSource = bootloaderBytes;
		else if ((type & DfuBaseService.TYPE_APPLICATION) > 0)
			currentSource = applicationBytes;
		bytesReadFromCurrentSource = 0;
		mark(0);
		reset();
		return this.type;
	}
915512
public function setContentType($contentType)
    {
        if (is_bool(strpos($contentType, 'charset=')) && $this->charset) {
            $contentType .= '; charset=' . $this->charset;
        }
        
        $this->headers['Content-Type'] = $contentType;
        return $this;
    }