Set the preferred content disposition type 'attachement' or 'inline'.

@throws Exception\InvalidArgumentException

@param string $content_disposition_type

@return SimpleHeaders
343275
public function setContentDispositionType($content_disposition_type)
    {
        if (!in_array($content_disposition_type, $this->disposition_types, true)) {
            $supported = implode(',', $this->disposition_types);
            throw new Exception\InvalidArgumentException(__METHOD__ . " Content disposition type '$content_disposition_type' not in supported types: $supported");
        }

        $this->params['content-disposition-type'] = $content_disposition_type;

        return $this;
    }
636377
public function setContentType($contentType, $charset=NULL){
        $this->setHeader("Content-Type", $contentType);
        if($charset != NULL){
            $this->setHeader("charset", $charset);
        }
    }
615420
private function isValidContentType(string $contentType): void
    {
        $allowedContentType = $this->getAllowedContentType();
        if (!\in_array($contentType, $allowedContentType, true)) {
            throw new InvalidTypeException('Invalid content type.');
        }
    }
352888
public function setContentType($type, $statusCode=null)
    {
        if (isset(static::$_types[$type])) {
            $type = static::$_types[$type];
        }
        $this->setHeader('Content-Type', $type);
        if ($statusCode) {
            $this->_statusCode = $statusCode;
        }
    }
914338
public static function setContentType($contentType, $encoding = null) {
		$value = $contentType;
		if (isset ( $encoding ))
			$value .= ' ;charset=' . $encoding;
		self::header ( 'Content-Type', $value );
	}
1217844
protected function SetMessageType() {
    $this->message_type = array();
    if($this->AlternativeExists()) $this->message_type[] = "alt";
    if($this->InlineImageExists()) $this->message_type[] = "inline";
    if($this->AttachmentExists()) $this->message_type[] = "attach";
    $this->message_type = implode("_", $this->message_type);
    if($this->message_type == "") $this->message_type = "plain";
  }
614499
protected function setMessageType()
    {
        $this->message_type = array();
        if ($this->alternativeExists()) {
            $this->message_type[] = 'alt';
        }
        if ($this->inlineImageExists()) {
            $this->message_type[] = 'inline';
        }
        if ($this->attachmentExists()) {
            $this->message_type[] = 'attach';
        }
        $this->message_type = implode('_', $this->message_type);
        if ($this->message_type == '') {
            $this->message_type = 'plain';
        }
    }
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);
    }
771010
protected function setContentType($path, $content)
    {
        $custom_headers = [
            'Content-Type' => Util::guessMimeType($path, $content),
        ];

        return $this->normalizeResponse(
            $this->cosApi->update($this->getBucket(), $path, null, null, $custom_headers)
        );
    }
551268
public function contentAlternative($content, $contentType = null, $charset = null)
    {
        $this->getSwiftMessage()->addPart($content, $contentType, $charset);

        return $this;
    }
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 . '"' );
    }
936463
public function setFileType($fileType)
    {
        if ($fileType == $this->fileType) return $this;
        if (!isset(self::getFileTypes()[$fileType])) {
            throw new \InvalidArgumentException(sprintf('"%s" is not a valid file type.', $fileType));
        }

        $this->fileType = $fileType;
        return $this;
    }
767841
public void setContentType(String contentType) throws InvalidArgumentException {
    if (Strings.isNullOrEmpty(contentType)) {
      throw new InvalidArgumentException("empty content type");
    }

    this.contentType = contentType;
  }
685440
public function setContentType(string $contentType, string $contentCharset = null): self
    {
        $this->contentType = $contentType;

        if ($contentCharset !== null) {
            $this->setContentCharset($contentCharset);
        }

        return $this;
    }
884174
protected function prepareHeaders(
        InternalRequestInterface &$internalRequest,
        $associative = true,
        $contentType = true,
        $contentLength = false
    ) {
        if (!$internalRequest->hasHeader('Connection')) {
            $internalRequest = $internalRequest->withHeader(
                'Connection',
                $this->configuration->getKeepAlive() ? 'keep-alive' : 'close'
            );
        }

        if (!$internalRequest->hasHeader('Content-Type')) {
            $rawDatas = (string) $internalRequest->getBody();
            $datas = $internalRequest->getDatas();
            $files = $internalRequest->getFiles();

            if ($this->configuration->hasEncodingType()) {
                $internalRequest = $internalRequest->withHeader(
                    'Content-Type',
                    $this->configuration->getEncodingType()
                );
            } elseif ($contentType && !empty($files)) {
                $internalRequest = $internalRequest->withHeader(
                    'Content-Type',
                    ConfigurationInterface::ENCODING_TYPE_FORMDATA.'; boundary='.$this->configuration->getBoundary()
                );
            } elseif ($contentType && (!empty($datas) || !empty($rawDatas))) {
                $internalRequest = $internalRequest->withHeader(
                    'Content-Type',
                    ConfigurationInterface::ENCODING_TYPE_URLENCODED
                );
            }
        }

        if ($contentLength && !$internalRequest->hasHeader('Content-Length')
            && ($length = strlen($this->prepareBody($internalRequest))) > 0) {
            $internalRequest = $internalRequest->withHeader('Content-Length', (string) $length);
        }

        if (!$internalRequest->hasHeader('User-Agent')) {
            $internalRequest = $internalRequest->withHeader('User-Agent', $this->configuration->getUserAgent());
        }

        return HeadersNormalizer::normalize($internalRequest->getHeaders(), $associative);
    }
31228
protected function setAssumedContentType($type)
    {
        if (!in_array($type, $this->acceptedContentTypes)) {
            throw new \InvalidArgumentException("Content type '$type' is not accepted, so it can not be assumed");
        }
        $this->assumedContentType = $type;
    }
511426
private function selectContentTypeHeader($contentType)
    {
        if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) {
            return 'application/json';
        } elseif (preg_grep("/application\/json/i", $contentType)) {
            return 'application/json';
        } else {
            return implode(',', $contentType);
        }
    }