def _get_mime_type(content_type):
  """Parse mime type.
  
  Args:
    content_type: content-type of response.
  
  Returns:
    returns string parsed to a media type.
    If content_type is None, returns none value.
  """
  if content_type is None:
    return None
  
  if ";" in content_type:
    i = content_type.index(";")
    content_type = content_type[:i]
  fields = content_type.split("/")
  for i in range(len(fields)):
    fields[i] = fields[i].strip().lower()
  mime_type = "/".join(fields)
  return mime_type