Returns the content type of the request body.
An empty string will be returned if the header is missing.

@return string
331006
public function getContentType(): string
	{
		if($this->contentType === null)
		{
			$this->contentType = rtrim(strtok((string) $this->headers->get('content-type'), ';'));
		}

		return $this->contentType;
	}
1113953
public function getBodyParams()
    {
        if (is_array($this->bodyParams)) {
            return $this->bodyParams;
        }

        $content = $this->getBody()->getContents();
        $contentType = $this->headers->get('content-type');
        if ($contentType === 'application/json') {
            $bodyParams = json_decode($content, true);
            $this->bodyParams = $bodyParams ? $bodyParams : [];
        } else {
            parse_str($content, $this->bodyParams);
        }
        return $this->bodyParams;
    }
177754
public function contentType()
    {
        $contentType = $this->server('CONTENT_TYPE');
        if ($contentType) {
            if (strpos($contentType, ';')) {
                list($type) = explode(';', $contentType);
            } else {
                $type = $contentType;
            }
            return trim($type);
        }
        return '';
    }
22263
public function getParsedBody()
    {
        if (!in_array($this->getMethod(), ['GET', 'POST'])) {
            if ($this->getContentType() == 'application/x-www-form-urlencoded') {
                $input_contents = $this->getRawData();
                
                if (function_exists('mb_parse_str')) {
                    mb_parse_str($input_contents, $post_vars);
                } else {
                    parse_str($input_contents, $post_vars);
                }
                if (count($_GET) > 0) {
                    $post_vars = array_merge($post_vars, $_GET);
                }
                return $post_vars;
            } else {
                throw new \UnexpectedValueException('Content-type não aceito');
            }
        } elseif ($this->getMethod() == 'POST') {
            if (count($_GET) > 0) {
                $_POST = array_merge($_POST, $_GET);
            }

            return $_POST;
        } elseif ($this->getMethod() == 'GET') {
            return $_GET;
        }
    }
801869
public static function getContentType() {
    if(null === self::$contentType) {
      self::$contentType = @trim($_SERVER['HTTP_CONTENT_TYPE']);
      if(!self::$contentType) {
        self::$contentType = @trim($_SERVER['CONTENT_TYPE']);
        if(!self::$contentType) {
          self::$contentType = false;
        }
      }
    }
    return self::$contentType;
  }
995087
public String getBodyContentType() {
        if (networkRequest != null && networkRequest.contentType != null) {
            return networkRequest.contentType.toString();
        }
        return null;
    }
879757
public function getBody()
    {
        $body = '';
        if ($this->_method === 'POST' || $this->_method === 'PUT') {
            if ($this->_body === null) {
                $this->_body = $this->getPostBody();
            }
            $this->setHeader('content-length', strlen($this->_body));
            $body = $this->_body . Client::CRLF;
        }
        return $body;
    }
1314226
public function getHeaders()
    {
        $headers = array();
        if (isset($_SERVER)) {
            foreach ($_SERVER as $key => $val) {
                if (substr($key, 0, 5) == 'HTTP_') {
                    // convert HTTP_CONTENT_TYPE to Content-Type, HTTP_HOST to Host, etc.
                    $name = strtolower(substr($key, 5));
                    $name = str_replace(' ', '-', ucwords(str_replace('_', ' ', $name)));
                    $headers[$name] = $val;
                }
            }
        }
        if (count($headers) > 0) {
            return $headers;
        } else {
            return null;
        }
    }
401970
public function get_type()
	{
		if (isset($this->file->headers['content-type']))
		{
			if (!isset($this->file->headers['content-encoding'])
				&& ($this->file->headers['content-type'] === 'text/plain'
					|| $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1'
					|| $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1'
					|| $this->file->headers['content-type'] === 'text/plain; charset=UTF-8'))
			{
				return $this->text_or_binary();
			}

			if (($pos = strpos($this->file->headers['content-type'], ';')) !== false)
			{
				$official = substr($this->file->headers['content-type'], 0, $pos);
			}
			else
			{
				$official = $this->file->headers['content-type'];
			}
			$official = trim(strtolower($official));

			if ($official === 'unknown/unknown'
				|| $official === 'application/unknown')
			{
				return $this->unknown();
			}
			elseif (substr($official, -4) === '+xml'
				|| $official === 'text/xml'
				|| $official === 'application/xml')
			{
				return $official;
			}
			elseif (substr($official, 0, 6) === 'image/')
			{
				if ($return = $this->image())
				{
					return $return;
				}
				else
				{
					return $official;
				}
			}
			elseif ($official === 'text/html')
			{
				return $this->feed_or_html();
			}
			else
			{
				return $official;
			}
		}
		else
		{
			return $this->unknown();
		}
	}
1278573
public function getContentType()
    {
        $contentType = $this->getSubject()->contenttype;
        if ($contentType !== null && isset($contentType['slug'])) {
            return $contentType['slug'];
        }

        return null;
    }
516042
private String getRequestHeaderContentType() {
        String contentType = getRequestHeaderValue("Content-Type");
        if (contentType != null) {
            // remove parameter (Content-Type := type "/" subtype *[";" parameter] )
            int index = contentType.indexOf(';');
            if (index > 0)
                contentType = contentType.substring(0, index);
            contentType = contentType.trim();
        }
        return contentType;
    }
119674
private ContentType getContentType() {
        String contentTypeValue = m_request.getContentType();
        if (contentTypeValue == null) {
            return ContentType.TEXT_XML;
        }
        return new ContentType(contentTypeValue);
    }
513720
private function getResponseType()
    {
        if (false === strpos($this->url, '.')) {
            return "";
        }
        list($path, $type) = explode('.', basename($this->url), 2);

        return $type;
    }
1203652
def content_type(self):  # type: () -> str
        
        # todo(mvsusp): consider a better default content-type
        return self.headers.get('ContentType') or self.headers.get(
            'Content-Type') or _content_types.JSON
1247242
public function getHtmlBody(){
        $bodies = $this->parent->getBodies();
        if (!isset($bodies['html'])) {
            return null;
        }

        return $bodies['html']->content;
    }
780804
public function getRequestBody() {
    if (!$this->evaluated) {
      $this->evaluateWebPage();
    }

    if ($this->webPage instanceof JsonPage) {
      $serializer = $this->router->getJsonSerializer();
      return $serializer->serialize($this->rawRequestBody);
    } else {
      return $this->rawRequestBody;
    }
  }
496771
protected function getContenType(): string
	{
		return $this->contentType ?? ($this->fileSystem->info($this->filePath)->getMimeType() ?? 'application/octet-stream');
	}