The value of content part for Content-Type HTTP header.
176992
def content_type(self) -> str:
        """"""
        raw = self._headers.get(hdrs.CONTENT_TYPE)  # type: ignore
        if self._stored_content_type != raw:
            self._parse_content_type(raw)
        return self._content_type
797320
private static String getResponseMimeType(final HttpResponse httpHeadResponse) {
        Header contentTypeHeader = httpHeadResponse.getFirstHeader("Content-Type");
        if (contentTypeHeader != null) {
            String contentType = contentTypeHeader.getValue();
            if (contentType != null) {
                try {
                    return ContentType.parse(contentType).getMimeType();
                } catch (ParseException | UnsupportedCharsetException exception) {
                    return contentType.split(";")[0].trim();
                }
            }
        }

        return ContentType.DEFAULT_TEXT.getMimeType();
    }
471226
public String headerOut(String name)
  {
    ArrayList<String> keys = _headerKeysOut;

    int headerSize = keys.size();
    for (int i = 0; i < headerSize; i++) {
      String oldKey = keys.get(i);

      if (oldKey.equalsIgnoreCase(name)) {
        return (String) _headerValuesOut.get(i);
      }
    }

    /*
    if (name.equalsIgnoreCase("content-type")) {
      throw new UnsupportedOperationException();
      //return request().getContentType();
    }
    */

    if (name.equalsIgnoreCase("content-length")) {
      return _contentLengthOut >= 0 ? String.valueOf(_contentLengthOut) : null;
    }
    
    if (name.equalsIgnoreCase("content-type")) {
      return _contentTypeOut;
    }

    return null;
  }
890185
def content_type(self, data):
        """"""
        self._content_type = str(data)
        self.add_header('Content-Type', str(data))
571255
private void preparePostHeader(HttpPost httpPost, String acceptMimeType, String contentMimeType) {
    if (acceptMimeType != null && !acceptMimeType.equals("")) {
      httpPost.setHeader(new BasicHeader("accept", acceptMimeType));
    }
    if (contentMimeType != null && !contentMimeType.equals("")) {
      httpPost.setHeader(new BasicHeader("Content-Type", contentMimeType));
    }
    httpPost.setHeader(new BasicHeader("project-id", projectId));
    if (token != null && bearerToken != null) {
      httpPost.setHeader(new BasicHeader("authorization", bearerToken.replaceAll("\"", "")));
    }
  }
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
813910
public Optional<String> toContentTypeHeader() {
        return contentType.map(ct -> {
            if (charset.isPresent()) {
                return ct + "; charset=" + charset.get();
            } else {
                return ct;
            }
        });
    }
925939
private ContentType parseContentType(String value) {
        String[] pcs = value.split("\\;");
        String mimeType = pcs[0].trim();
        String charSet = "UTF-8";
        
        for (int i = 1; i < pcs.length; i++) {
            String s = pcs[i].trim().toUpperCase();
            
            if (s.startsWith("CHARSET=")) {
                charSet = s.substring(8);
                break;
            }
        }
        
        return ContentType.create(mimeType, charSet);
    }
429005
private boolean headerOutSpecial(String key, String value)
  {
    int length = key.length();
    
    if (length == 0) {
      return false;
    }
    
    int ch = key.charAt(0);
    
    if ('A' <= ch && ch <= 'Z') {
      ch += 'a' - 'A';
    }
    
    int code = (length << 8) + ch;
    
    switch (code) {
    case 0x0d00 + 'c':
      if (CACHE_CONTROL.matchesIgnoreCase(key)) {
        // server/13d9, server/13dg
        if (value.startsWith("max-age")) {
        }
        else if (value.startsWith("s-maxage")) {
        }
        else if (value.equals("x-anonymous")) {
        }
        else {
          //request().setCacheControl(true);
          if (true) throw new UnsupportedOperationException();
        }
      }

      return false;

    case 0x0a00 + 'c':
      if (CONNECTION_CB.matchesIgnoreCase(key)) {
        if ("close".equalsIgnoreCase(value))
          killKeepalive("client connection: close");
        return true;
      }
      else {
        return false;
      }

    case 0x0c00 + 'c':
      if (CONTENT_TYPE_CB.matchesIgnoreCase(key)) {
        headerOutContentType(value);
        
        return true;
      }
      else {
        return false;
      }

    case 0x0e00 + 'c':
      if (CONTENT_LENGTH_CB.matchesIgnoreCase(key)) {
        // server/05a8
        // php/164v
        _contentLengthOut = parseLong(value);
        return true;
      }
      else {
        return false;
      }

    case 0x0400 + 'd':
      if (DATE.matchesIgnoreCase(key)) {
        return true;
      }
      else {
        return false;
      }

    case 0x0600 + 's':
      if (SERVER.matchesIgnoreCase(key)) {
        _serverHeader = value;
        return true;
      }
      else {
        return false;
      }

    default:
      return false;
    }
  }
670479
def parse_content_type(header):
    """"""
    typ = subtyp = None; options = {}
    typ, pos = expect_re(re_token, header, 0)
    _, pos = expect_lit('/', header, pos)
    subtyp, pos = expect_re(re_token, header, pos)
    ctype = header[:pos] if subtyp else ''
    while pos < len(header):
        _, pos = accept_ws(header, pos)
        _, pos = expect_lit(';', header, pos)
        _, pos = accept_ws(header, pos)
        name, pos = expect_re(re_token, header, pos)
        _, pos = expect_lit('=', header, pos)
        char = lookahead(header, pos)
        if char == '"':
            value, pos = expect_re(re_qstring, header, pos)
            value = re_qpair.sub('\\1', value)
        elif char:
            value, pos = expect_re(re_token, header, pos)
        if name and value is not None:
            options[name] = value
    return ctype, options
1218196
def _get_acceptable_response_type():
    """"""
    if ('Accept' not in request.headers or request.headers['Accept'] in
            ALL_CONTENT_TYPES):
        return JSON
    acceptable_content_types = set(
        request.headers['ACCEPT'].strip().split(','))
    if acceptable_content_types & HTML_CONTENT_TYPES:
        return HTML
    elif acceptable_content_types & JSON_CONTENT_TYPES:
        return JSON
    else:
        # HTTP 406 Not Acceptable
        raise InvalidAPIUsage(406)
229478
def headers(self):
        """"""
        return {
            "Content-Type": ("multipart/form-data; boundary={}".format(self.boundary)),
            "Content-Length": str(self.len),
            "Content-Encoding": self.encoding,
        }
219299
def parseAcceptHeader(value):
    
    chunks = [chunk.strip() for chunk in value.split(',')]
    accept = []
    for chunk in chunks:
        parts = [s.strip() for s in chunk.split(';')]

        mtype = parts.pop(0)
        if '/' not in mtype:
            # This is not a MIME type, so ignore the bad data
            continue

        main, sub = mtype.split('/', 1)

        for ext in parts:
            if '=' in ext:
                k, v = ext.split('=', 1)
                if k == 'q':
                    try:
                        q = float(v)
                        break
                    except ValueError:
                        # Ignore poorly formed q-values
                        pass
        else:
            q = 1.0

        accept.append((q, main, sub))

    accept.sort()
    accept.reverse()
    return [(main, sub, q) for (q, main, sub) in accept]
1081911
def content_type(self, content_type):
        
        allowed_values = ["application/json", "text/html", "text/plain", "application/x-www-form-urlencoded", ""]  # noqa: E501
        if content_type not in allowed_values:
            raise ValueError(
                "Invalid value for `content_type` ({0}), must be one of {1}"  # noqa: E501
                .format(content_type, allowed_values)
            )

        self._content_type = content_type
1300707
def handleHeader(self, key, value):
        """"""

        if key == 'CIMError':
            self.CIMError = urllib.parse.unquote(value)
        if key == 'PGErrorDetail':
            self.PGErrorDetail = urllib.parse.unquote(value)
1049033
private String getContentType(HttpServletRequest pRequest) {
        if (responseMessageTypes != null) {
            String accept = pRequest.getHeader("Accept");

            for (String type : responseMessageTypes) {
                // Note: This is not 100% correct way of doing content negotiation
                // But we just want a compatible result, quick, so this is okay
                if (StringUtil.contains(accept, type)) {
                    return type;
                }
            }
        }

        // If none found, return default
        return DEFAULT_TYPE;
    }
757880
public String getContentType() {
        final Object contentType = getHeader(HttpMessageHeaders.HTTP_CONTENT_TYPE);

        if (contentType != null) {
            return contentType.toString();
        }

        return null;
    }